NullPointerException « Fetch « JPA Q&A





1. NullPointerException when I Try to retrieve information    forum.hibernate.org

This is the problem. I have two entities: Profile and User. 1 user has many profiles But 1 user also has an "active profile". An active profile is the profile this user is currently using. Table USER: USER_ID: VARCHAR(10) NAME: VARCHAR(20) EMAIL: VARCHAR(20) SERIAL_NUMBER:VARCHAR(20) PROFILE_ID: INTEGER (this is the foreign key that references the active profile) Table PROFILE: PROFILE_ID: INTEGER NAME: ...

2. [HQL] Join with fetch gives NullPointerException    forum.hibernate.org

java.lang.NullPointerException at org.hibernate.loader.BasicLoader.isBag(BasicLoader.java:71) at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:53) at org.hibernate.loader.hql.QueryLoader.(QueryLoader.java:96) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:181) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623) at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:106) ...