This content has been marked as final.
Show 3 replies
-
1. Re: 1.2.2 snapshot: NPE while processing configuration of th
adamw Nov 30, 2009 2:43 AM (in response to obeah)Hello,
yes, that's right, all classes have the id-mapper generated, because of the new possibility to audit relations to non-audited entities.
Could you post your mapping, so that I could reproduce the problem? Composite IDs should normally work fine, so you must have something special :)
Adam -
2. Re: 1.2.2 snapshot: NPE while processing configuration of th
obeah Nov 30, 2009 3:38 AM (in response to obeah)Hello, Adam,
Below are composite-id mappings for all 3 classes. At least the last one is very simple. Maybe it has to do with the way I build configuration? Probably calling buildMappings is not enough and hibernate doesn't initialize internal meta-data for composite ids?configuration = new AnnotationConfiguration(); configuration.addProperties(hibernateProperties); // add resource files for (String resource : allMappingResources) { configuration.addResource(resource); } for(Class<? extends Object> item : allAnnotatedClasses){ configuration.addAnnotatedClass(item); } // in order to configure envers tables main configuration has to be built before configuration.buildMappings(); // configure envers AuditConfiguration.getFor(configuration);
Class 1:
<composite-id unsaved-value="any"> <key-many-to-one name="accountGroup" access="field" class="com.loanworkbench.persist.LoanAccountGroup"> <column name="group_uuid" not-null="true" sql-type="char(32)"/> </key-many-to-one> <key-property name="number" access="field" type="integer" column="`number`"/> </composite-id>
Class 2
<composite-id unsaved-value="any"> <key-many-to-one name="partner" access="field" class="com.loanworkbench.data.partner.Partner"> <column name="partner_uuid" not-null="true" sql-type="char(32)"/> </key-many-to-one> <key-many-to-one name="branch" access="field" class="com.softgenic.data.Branch" foreign-key="pbranch_fk"> <column name="branch_uuid" sql-type="char(32)" not-null="true"/> </key-many-to-one> </composite-id>
Class 3:
<composite-id> <key-property name="objectNumberId" access="field" column="object_num" length="10"/> <key-property name="structureId" access="field" column="structure" length="6"/> <key-property name="sectionId" access="field" column="section" length="6"/> <key-property name="parameterValue" access="field" column="param_value" length="40"/> </composite-id>
-
3. Re: 1.2.2 snapshot: NPE while processing configuration of th
adamw Dec 1, 2009 2:34 AM (in response to obeah)Hello,
I just deployed a new snapshot with a check for supported id mappings so this should now work.
Thanks for the beta-testing :)
Adam