Hi Folks,
I've got a bit of a problem which is probably due to being a hibernate newbie.
I'm getting these errors when calling getSessionFactory():
Code:
Jun 30, 2011 5:41:59 PM org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader checkForOrphanProperties
WARNING: Property vortex.model.Asset.Type not found in class but described in <mapping-file/> (possible typo error)
Jun 30, 2011 5:41:59 PM org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader checkForOrphanProperties
WARNING: Property vortex.model.Asset.AssetTag not found in class but described in <mapping-file/> (possible typo error)
Jun 30, 2011 5:41:59 PM org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader checkForOrphanProperties
WARNING: Property vortex.model.Asset.PurchaseDate not found in class but described in <mapping-file/> (possible typo error)
Jun 30, 2011 5:41:59 PM org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader checkForOrphanProperties
... lots more like above but for different variables and classes ...
... truncated ...
Jun 30, 2011 5:41:59 PM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: vortex.model.Asset
Jun 30, 2011 5:41:59 PM org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity vortex.model.Asset on table Asset
2011-06-30 17:41:59,593 ERROR [vortex.admintool.cli.CliSecurityLoad] loadPerms: Exception getting PermissionManager: org.hibernate.AnnotationException: No identifier specified for entity: vortex.model.Asset
#0: org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:268)
#1: org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:223)
#2: org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:686)
#3: org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035)
#4: org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989)
#5: org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398)
#6: org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)
#7: vortex.db.PersistManager.getSessionFactory(PersistManager.java:219)
#8: vortex.db.PersistManager.getSession(PersistManager.java:199)
The vortex.model.Asset class is referenced in hibernate.cfg.xml (see below) and is defined in orm.xml (below). The vortex.model.Asset.AssetTag member is not a class, but a variable in class Asset. Same for the other vortex.model.Asset.* references in the errors.
I've used Texo to generate the orm.xml file which looks like this (truncated version):
Code:
<?xml version="1.0" encoding="ASCII"?>
<orm:entity-mappings xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" version="2.0">
<orm:access>FIELD</orm:access>
<orm:entity class="vortex.model.StateInfo" name="StateInfo">
<orm:attributes>
<orm:basic name="IdleTime" optional="true"/>
<orm:basic name="LockTimeout" optional="true"/>
<orm:basic name="RadioSigStrength" optional="true"/>
<orm:basic name="StorageAvail" optional="true"/>
<orm:basic name="BatChargeRemain" optional="true"/>
<orm:basic name="BatCurrentVoltage" optional="true"/>
<orm:basic name="Updated" optional="true">
<orm:temporal>DATE</orm:temporal>
</orm:basic>
<orm:many-to-one name="MobileProvider" optional="true" target-entity="vortex.model.MobileProvider">
<orm:join-column/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
<orm:many-to-one name="PhoneNumber" optional="true" target-entity="vortex.model.PhoneNumber">
<orm:join-column/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
</orm:attributes>
</orm:entity>
<orm:entity class="vortex.model.SystemInfo" name="SystemInfo">
<orm:attributes>
<orm:basic name="osName" optional="true"/>
<orm:basic name="OsVersion" optional="true"/>
<orm:basic name="DevIdent" optional="true"/>
<orm:basic name="Config" optional="true"/>
<orm:basic name="SIM" optional="true"/>
<orm:basic name="IMEI" optional="true"/>
<orm:basic name="IMSI" optional="true"/>
<orm:basic name="DefaultEmailAddr" optional="true"/>
<orm:basic name="Updated" optional="true">
<orm:temporal>DATE</orm:temporal>
</orm:basic>
</orm:attributes>
</orm:entity>
<orm:entity class="vortex.model.Asset" name="Asset">
<orm:attributes>
<orm:basic name="ID" optional="true"/>
<orm:basic name="Type" optional="true"/>
<orm:basic name="status" optional="true"/>
<orm:basic name="AssetTag" optional="true"/>
<orm:basic name="PurchaseDate" optional="true">
<orm:temporal>DATE</orm:temporal>
</orm:basic>
<orm:basic name="OwnerNameFromUser" optional="true"/>
<orm:basic name="OwnerInfoFromUser" optional="true"/>
<orm:basic name="Notes" optional="true"/>
<orm:basic name="Created" optional="true">
<orm:temporal>DATE</orm:temporal>
</orm:basic>
<orm:basic name="Updated" optional="true">
<orm:temporal>DATE</orm:temporal>
</orm:basic>
<orm:many-to-one name="SystemInfo" optional="true" target-entity="vortex.model.SystemInfo">
<orm:join-column/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
<orm:many-to-one name="Hardware" optional="true" target-entity="vortex.model.Hardware">
<orm:join-column/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
<orm:many-to-one name="Registration" optional="true" target-entity="vortex.model.Registration">
<orm:join-column/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
<orm:many-to-one name="Agent" optional="true" target-entity="vortex.model.Agent">
<orm:join-column/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
<orm:many-to-many name="StateInfo" target-entity="vortex.model.StateInfo">
<orm:order-column/>
<orm:join-table name="Asset_StateInfo"/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-many>
<orm:many-to-many name="Entities" target-entity="vortex.model.Entity">
<orm:order-column/>
<orm:join-table name="Asset_Entities"/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-many>
<orm:many-to-many name="Apps" target-entity="vortex.model.App">
<orm:order-column/>
<orm:join-table name="Asset_Apps"/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-many>
<orm:many-to-many name="Locations" target-entity="vortex.model.Location">
<orm:order-column/>
<orm:join-table name="Asset_Locations"/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-many>
<orm:many-to-many name="Policies" target-entity="vortex.model.Policy">
<orm:order-column/>
<orm:join-table name="Asset_Policies"/>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-many>
</orm:attributes>
</orm:entity>
...truncated...
My hibernate.cfg.xml contains
Code:
<mapping class="vortex.model.Asset"/>
<mapping class="vortex.model.StateInfo"/>
<mapping resource="vortex/resources/orm.xml"/>
I have only listed a few of the classes in hibernate.cfg.xml so far. I will add the rest once I get this working.
Would greatly appreciate any pointers on this one!
Thanks.
mike