pre-persist not firing

From: John Armstrong (siberia..iberian.org)
Date: Mon Dec 29 2008 - 19:51:34 EST

  • Next message: John Armstrong: "Hinting for datatype in Modeler?"

    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,

    Thanks
    John-



    This archive was generated by hypermail 2.0.0 : Tue Dec 30 2008 - 01:27:45 EST