This content has been marked as final.
Show 2 replies
-
1. Re: naming of attributes in queries
andydale Jan 19, 2007 4:22 AM (in response to micho)Hi,
Could you post up some your entity code, and the actual query you are trying to get to work.
Cheers,
Andy -
2. Re: naming of attributes in queries
micho Jan 19, 2007 5:25 AM (in response to micho)@Entity @Table(name = "Benutzer") public class User implements Serializable { private long mSid; private long mMandantID; private String mId; public User() { super(); } public String getId() { return mId; } public void setId(String pId) { mId = pId; } @Id @GeneratedValue(strategy=GenerationType.AUTO) public long getSid() { return mSid; } public void setSid(long pSid) { mSid = pSid; } public long getMandantID() { return mMandantID; } public void setMandantID(long pMandantID) { mMandantID = pMandantID; } }
List<User> erg = (List<User>) em.createQuery( "from User where (Id = :uid) and (pwd=:pwd) and (mandantID=:mandantid)") .setParameter ("uid", pUserName).setParameter ("pwd", pPwd).setParameter ("mandantid", lMandantID).getResultList();
this works,
mandantID, mandantid insted of MandantID works too
but id insted of Id doesn´t.