Hello,
I encounter NullPointerException when trying to get list of a table elements.
Mean that createQuery return Null but don"t understand why
Thanks.
Hibernate: select playerinfo0_.Id as Id73_, playerinfo0_.Name as Name73_, playerinfo0_.HistoryScore as HistoryS3_73_, playerinfo0_.Credits as Credits73_ from Player playerinfo0_
2006-04-16 01:47:19,919 : JFactory.postInvoke : system exception in business method:
java.lang.NullPointerException
Here my call :
final List players = ssn.createQuery("from PlayerInfo").list();
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.insia.hyplite.beans">
<class name="PlayerInfo" table="Player" lazy="true">
<id name="id" column="Id">
<generator class="native"/>
</id>
<property name="name" column="Name"/>
<property name="historyScore" column="HistoryScore"/>
<property name="credits" column="Credits"/>
<set name="planets" cascade="save-update,persist,delete" inverse="true">
<key column="PlayerId"/>
<one-to-many class="PlanetInfo"/>
</set>
<set name="alliances" inverse="true" table="AlliancePlayer">
<key column="playerId"/>
<many-to-many column="allianceId"
class="AllianceInfo"/>
</set>
</class>
</hibernate-mapping>
|