hibernate出錯 不能事例sessionFactory

lijie000發表於2007-07-28
<property name="age" type="java.lang.Integer" insert="false" update="false" formula="( select YEAR(GETDATE())-YEAR(u0.birthday) as age from userinfo u0 where u0.id=id )">
</property>
對映檔案里加了著行就不行了 錯誤提示:
%%%% Error Creating SessionFactory %%%%
java.lang.NullPointerException
at org.hibernate.loader.DefaultEntityAliases.intern(DefaultEntityAliases.java:133)
at org.hibernate.loader.DefaultEntityAliases.getSuffixedPropertyAliases(DefaultEntityAliases.java:106)
at org.hibernate.loader.DefaultEntityAliases.<init>(DefaultEntityAliases.java:52)
at org.hibernate.loader.ColumnEntityAliases.<init>(ColumnEntityAliases.java:16)
at org.hibernate.loader.custom.SQLCustomQuery.<init>(SQLCustomQuery.java:178)
at org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:20)
at org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:113)

相關文章