cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Armstrong" <siber...@gmail.com>
Subject Pre-persist not firing
Date Tue, 30 Dec 2008 16:02:37 GMT
This is really basic but I am a bit sick and am just not finding my
answer (thats my excuse, sick..)

In my map I have this (generated via M5 Modeler):

       <obj-entity name="Company" className="com.printgate.model.Company"
dbEntityName="COMPANY">
               <obj-attribute name="companyid" type="java.lang.String"
db-attribute-path="COMPANYID"/>
               <obj-attribute name="isactive" type="boolean"
db-attribute-path="ISACTIVE"/>
               <pre-persist method-name="generateCompanyID"/>
       </obj-entity>

In my com.printgate.model.Company object I have this method:

       public void generateCompanyID(){
               System.out.println("In generate");
       }

I call it like this :

       public BigTest(){
               context = DataContext.createDataContext();
               theCompany = (Company)
context.newObject(com.printgate.model.Company.class);
               context.commitChanges();
       }

The object is created in the datastore but my pre-persist never fires.

This is M5. I also rolled back to M4 with the same problem so I am
sure its something obvious that i am missing in how I wire it all
together (although it does work in another project I have).

Thanks
John-

Mime
View raw message