Re: AUto PK/ how to desactivate

From: jerome moliere (jerome.molier..mail.com)
Date: Tue Apr 10 2007 - 11:25:29 EDT

  • Next message: Andrus Adamchik: "Re: AUto PK/ how to desactivate"

    2007/4/10, Andrus Adamchik <andru..bjectstyle.org>:
    >
    > Just map the PK (entry_id) as an ObjAttribute (so it becomes object
    > property) and don't forget to set it to a non-null value before
    > commit. In this case Cayenne will skip the auto-generation step.

    So simple ?
    -) yes it works nice, I prefer your solution than my previous one, patching
    cayenne to disable the call... -)

    Thanks
    Jerome

    PS:
    have you ever thought about adopting a DTD/schema for config files ?
    I don't like the modeler GUI (I don't understand it very well) and I would
    like to have a greater knowledge about all configuration details.... Without
    grammar it's pretty hard to understand...

    Andrus
    >
    >
    > On Apr 10, 2007, at 2:39 PM, jerome moliere wrote:
    >
    > > Hi all,
    > > I'd like to trigger off the auto pk generation? I don't see how to
    > > do that ?
    > > Is it possible ?
    > >
    > >
    > > I 've got a small schema with a map.xml contents like this:
    > > <?xml version="1.0" encoding="utf-8"?>
    > > <data-map project-version="2.0">
    > > <property name="defaultPackage" value="data.dbcayenne"/
    > >>
    > > <property name="defaultSchema" value="dbo"/>
    > > <db-entity name="ztextTestT" schema="dbo"
    > > catalog="KplusLocal1">
    > > <db-attribute name="entry_id" type="INTEGER"
    > > isPrimaryKey="true" isMandatory=
    > > "true" length="10"/>
    > > <db-attribute name="ztext" type="LONGVARBINARY"
    > > isMandatory="true" length="21
    > > 47483647"/>
    > > </db-entity>
    > > <obj-entity name="ZtextTestT" className="data.dbcayenne
    > > .ZtextTestT" dbEntityName="ztextTestT">
    > > <obj-attribute name="ztext"
    > > type="dao.impl.cayenne.ZTextType"
    > > db-attribute-path="ztext"/>
    > > </obj-entity>
    > > </data-map>
    > >
    > > I'd like to have a PK strategy a la 'Hibernate assigned' where I
    > > 'll provide
    > > the key..
    > > (I can't make many things on the database managed by my customers,
    > > so I'd
    > > like to be as transparent as possible)
    > >
    > >
    > > Thanks
    > > Jerome
    > > --
    > > Jerome Moliere - Mentor/J
    > > http://romjethoughts.blogspot.com/
    > > auteur Eyrolles
    >
    >

    -- 
    Jerome Moliere - Mentor/J
    http://romjethoughts.blogspot.com/
    auteur Eyrolles
    



    This archive was generated by hypermail 2.0.0 : Tue Apr 10 2007 - 11:25:59 EDT