Actually after further testing i also get errors when i run the ignore case method. It seems like there might be bug or something with the ignore case stuff. I am using hibernate 3 with spring and hsqldb. By the way on the previous message i meant to say straight "hql" not "hsql"
Check out my code pretty simple
Code:
Criteria criteria = session.createCriteria(User.class).add(Restrictions.eq("username", userName).ignoreCase()).add(
Restrictions.eq("password", password));
List results2 = criteria.list();
I get the error on criteria.list() call. If i remove the ignore case it works without error. Again the query output runs fine in my db. here is the error
Code:
Hibernate: select this_.ID as ID0_, this_.VERSION as VERSION50_0_, this_.USERNAME as USERNAME50_0_, this_.PASSWORD as PASSWORD50_0_, this_.SYSTEM_ADMIN as SYSTEM5_50_0_, this_.ACTIVE as ACTIVE50_0_, this_.DEFAULT_COMPANY_ID as DEFAULT7_50_0_, this_.DEFAULT_PHYSICIAN_DATA_GROUP_ID as DEFAULT8_50_0_, this_.FIRST_NAME as FIRST9_50_0_, this_.LAST_NAME as LAST10_50_0_, this_.EMAIL as EMAIL50_0_, this_.PHONE_NUMBER as PHONE12_50_0_, this_.JOB_DESCRIPTION as JOB13_50_0_ from USERS this_ where lower(this_.USERNAME)=? and this_.PASSWORD=? and this_.ACTIVE=?
Exception in thread "main" java.lang.NullPointerException
at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249)
at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2831)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:218)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:163)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:655)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:261)
at org.hibernate.type.EntityType.resolve(EntityType.java:286)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:530)
at org.hibernate.loader.Loader.doQuery(Loader.java:436)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at com.smbs.model.dao.implementation.hibernate.security.SecurityDAO$1.doInHibernate(SecurityDAO.java:173)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:315)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:288)
at com.smbs.model.dao.implementation.hibernate.security.SecurityDAO.findUserByLogin(SecurityDAO.java:160)
at