Created
March 15, 2013 23:26
-
-
Save CaglarGonul/5174003 to your computer and use it in GitHub Desktop.
Fun with Electroserver, Hibernate and Thread Pool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon.hqls; | |
import game_db.entity.Userlogin; | |
import java.util.List; | |
import org.hibernate.Query; | |
import org.hibernate.Session; | |
public class SelectHQLS { | |
public static Userlogin getUserByUname(String userName,Session session){ | |
Query q = session.createQuery("from Userlogin where email=:uEmail"); | |
q.setString("uEmail", userName); | |
List results = q.list(); | |
if(results.isEmpty()) | |
return null; | |
Userlogin u = (Userlogin)results.get(0); | |
return u; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment