findReference, or create it ?

Franck Routier <[email protected]> Mon, 26 Jan 2009 10:01:05 +0100
Newsgroups gmane.comp.java.orm.simpleorm
Organization Axège Sarl
Message-ID <1232960465.8960.11.camel@franck-laptop>
Hi,

I have implemented the setInitialValue that was discussed on the list a
few week ago.

An example can be found in examples.Department.
Usage is fieldMeta.setInitialValue(ival);

Then your record will have the value of this field set to ival each a
_new_ record is created. So this will happen on create,
createWithNullKeys and findOrCreate in the case when the record is not
found.
Giving an initailValue to a primaryKey has no much sense, as the primary
keys are always explicitely given on creation, or set to null, but doing
so won't hurt.
InitialValue does not change the way dirtiness is handled.

So, implementing this, I came accross a behaviour I was not aware of :
findReference will really fnd _or create_ a reference ! I don't know if
this was done on purpose, but I think anyone should concious about it.

And my question : is this really the desired behaviour ?

Franck




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/