generic types (Tiger Java feature)

2004-10-02 Thread David Zejda
Are you considering generification of OJB? It would be nice to inherit from ManageableCollection, for instance. Thanks! David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to postinitialize...even with getCollectionByQuery

2004-07-29 Thread David Zejda
What do you recommend - should I redesign my model to make it not dependent on being informed whenewer an object completely materialized? Thanks. David David Zejda wrote: Mhmm, two things: * Are you sure that the thing object is actually stored in the db, i.e. is there a row for it after the

Re: how to postinitialize...even with getCollectionByQuery

2004-07-28 Thread David Zejda
Mhmm, two things: * Are you sure that the thing object is actually stored in the db, i.e. is there a row for it after the store call ? As I'm currently testing it on HSQLDB, there is the script [with most of ojb internal parts cut off]: CREATE TABLE SALE(A_ID INTEGER NOT NULL PRIMARY KEY,THING_I

Re: how to postinitialize...even with getCollectionByQuery

2004-07-27 Thread David Zejda
The PersistenceBrokerAware is a special case of listener, so you probably would get the same behaviour. But why is it not working for you ? Depending on what you're interested in, you override afterUpdate and afterLookup. The latter is called when you traverse the collection via the iterator's

Re: how to postinitialize...even with getCollectionByQuery

2004-07-27 Thread David Zejda
The solution was to replace org.apache.ojb.broker.cache.ObjectCacheDefaultImpl with org.apache.ojb.broker.cache.ObjectCacheEmptyImpl, so now it goes OK: Ugh. The seeming of connection between the objectcache and the order of initialization steps was only a result of a bug in my testcase, so the pro

Re: how to postinitialize objects... [possibly solved]

2004-07-27 Thread David Zejda
The initialization-method is called from the RowReaderDefaultImpl#readObjectFrom method as the last step, right after the field values have been set. The references and collections are read later, so if you require them, you'll have to either supply a Listener for PB events to the PersistenceBr

Re: how to postinitialize objects after being completely materialized

2004-07-26 Thread David Zejda
like this approach (due to the persistency layer "invading" your domain objects) - I am not one of them. HTH, Chaeers, -Original Message----- From: David Zejda [mailto:[EMAIL PROTECTED] Sent: 26 July 2004 09:59 To: OJB Users List Subject: how to postinitialize objects after being com

Re: little suggestion about "instanceof"

2004-07-26 Thread David Zejda
Imagine, you use the DummyCalendar in Calendar2DateFieldConversion. javaToSql will be ok. (... if (source instanceof Calendar) ...) but sqlToJava will materialize not the DummyCalendar (that you need), but a GregorianCalendar. (... GregorianCalendar cal = new GregorianCalendar()...) public cla

Re: little suggestion about "instanceof"

2004-07-26 Thread David Zejda
standard implemenation for equals(). see Effective Java by Josh Bloch. jakob David Zejda schrieb: I think, it would be better to use something like ((source != null) && (source.getClass()==Calendar.class)) { ... in conversion strategies than if (source instanceof Calendar) { ...

Re: little suggestion about "instanceof"

2004-07-26 Thread David Zejda
Thanks for your testcase. Imagine, you use the DummyCalendar in Calendar2DateFieldConversion. javaToSql will be ok. (... if (source instanceof Calendar) ...) but sqlToJava will materialize not the DummyCalendar (that you need), but a GregorianCalendar. (... GregorianCalendar cal = new GregorianC

Re: little suggestion about "instanceof"

2004-07-26 Thread David Zejda
... David Guillaume -Message d'origine----- De : David Zejda [mailto:[EMAIL PROTECTED] Envoye : samedi 24 juillet 2004 07:59 A : OJB Users List Objet : little suggestion about "instanceof" I think, it would be better to use something like ((source != null) && (source.getClass

Re: how to postinitialize objects after being completely materialized

2004-07-26 Thread David Zejda
Thanks, Thomas & Charles... I'll try it out. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

how to postinitialize objects after being completely materialized

2004-07-26 Thread David Zejda
I have a custom row reader able to initialize materialized objects by their _postinit() methods. Essentially it works, but there is a problem - the _postinit() should be called after the object is materialized completely, i.e. with all fields, but also references and collections filled. So, I guess

little suggestion about "instanceof"

2004-07-23 Thread David Zejda
I think, it would be better to use something like ((source != null) && (source.getClass()==Calendar.class)) { ... in conversion strategies than if (source instanceof Calendar) { ... to avoid reducing e.g. custom Calendar subclass to Calendar during conversion. David --

Re: Persistent storage of collection of primitive types

2004-07-23 Thread David Zejda
Use conversion="org.apache.ojb.broker.accesslayer.conversions.StringList2VarcharFieldConversion" or conversion="org.apache.ojb.broker.accesslayer.conversions.StringVector2VarcharFieldConversion" or create your own conversion strategy. /** * @ojb.field jdbc-type="VARCHAR" *conversion

how to postinitialize objects after being completely materialized

2004-07-23 Thread David Zejda
I have a custom row reader able to initialize materialized objects by their _postinit() methods. Essentially it works, but there is a problem - the _postinit() should be called after the object is materialized completely, i.e. with all fields, but also references and collections filled. So, I g

Re: property value is not auto-retrieved

2004-07-23 Thread David Zejda
Sorry - it seems that the bug is elsewhere - in a controller being used to manage persistence, so don't fiddle it more.. One way or another, thanks for your suggestion to use Integers instead of ints as a type for keys.. David Thanks for a quick reply. I corrected the classes as you suggested, b

Re: property value is not auto-retrieved

2004-07-23 Thread David Zejda
You shouldn't use the primarykey of We as the foreignkey for the instance of Subject. The foreignkey will be filled with the primarykey value of the Subject instance when you store the We object and it has an associated Subject object. Instead add an additional field to the We class, e.g. int su

property value is not auto-retrieved

2004-07-23 Thread David Zejda
What's wrong with the classes below? The "We" instance loaded from db has "master_id" property set correctly, but the "we" property is null. public class Subject { /** * Artificial ID key holder * * @ojb.field nullable="false" *autoincrement="ojb" *

possibly minor XDoclet bug

2004-07-22 Thread David Zejda
SCENARIO: There are 2 classes: abstract class Abstract class Sub extends Abstract where Abstract contains collection of Sub type. PROBLEM: There are foreign-key tags missing in Torque schema generated by XDoclet. EXAMPLE: /** * @ojb.class include-inherited="true" */ public class Sub extends Abstr

class in more extents

2004-07-21 Thread David Zejda
abstract A interface B AB1 extends A implements B AB2 extends A implements B AB3 extends A B1 implements B and I need both extents A and B, to have references to both "A" and "B" types. Will OJB manage such scenario or should I redesign the model? E.g. plug the classes under A hierarchy? Would it

thanks for a new XDoclet sanity checks..

2004-07-20 Thread David Zejda
It's much more comfortable to find the missing p/keys now, thanks.. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: OJB capable SortedSet [Re: The collection has no foreignkeys, says XDoclet]

2004-07-20 Thread David Zejda
Thomas Dudziak wrote: David Zejda wrote: You have a missing quotation mark for the collection-class attribute, thanks for a quick reply - sorry about my blindness No problem, happens to all of us :-) Btw, I don't think that TreeSet works as the collection-class, you should use one o

OJB capable SortedSet [Re: The collection has no foreignkeys, says XDoclet]

2004-07-20 Thread David Zejda
You have a missing quotation mark for the collection-class attribute, thanks for a quick reply - sorry about my blindness Btw, I don't think that TreeSet works as the collection-class, you should use one of the classes provided by OJB. Same for using SortedSet as the variable type - you have to

The collection has no foreignkeys, says XDoclet

2004-07-20 Thread David Zejda
I need bidirectional 1:n relation, but I'm still mising something... Please, have a look on a two simple classes. package oit.ucase; /** * @ojb.class include-inherited="true" *table="USECASE_HIERARCHY" */ public class Deposit { /** * Artificial ID key holder * * @o

Re: Difficultity with abstract mapping

2004-07-06 Thread David Zejda
The main problem with tables denormalised to contain more real world entities is possibility to fill unrelated fields (e.g. both from Group and Role). But if you let the persistency completely on mapping tool (OJB), you don't have to worry about it - OJB will not mangle them.. The main remainin

Re: Difficultity with abstract mapping

2004-07-05 Thread David Zejda
Marcus Young wrote: Each class is mapped to a separate table. I persuaded, that it's much easier to map the whole hierarchy to one table and provide ojbConcreteClass.. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: (xdoclet -> torque) with reference to interface

2004-06-29 Thread David Zejda
The classes I sent you yesterday don't go through the xdoclet succesfully although I'm using the newly downloaded jars. But maybe I have the bad jars? - their sfv checksum is in attachment. Thanks David > David Zejda wrote: > > > The problem with pk/fk unfortunately rem

(xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
> > > >Maybe it's the problem - I declared them (pk, ojbConcreteClass) in the > > > >abstract class and referenced the interface. > > > > > > > This could also explain the error about the different number of PKs vs. > > FKs. > > > As a general rule, every class that is referenced by a persistent >

Re: (xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
> >My scenario is simple: > > > >MyInterface > >MyAbstractClass implements MyInterface > >MyClass extends MyAbstractClass > >(and a few more subclasses) > > > >where > > > >-all of them are provided with ojb.class, mapped to the same table > >-MyAbstractClass contains artificial primary key and ojb

nested primary keys

2004-06-28 Thread David Zejda
I have classes A, B, both with artificial id's as a primary keys. If I nest A into B, should I override primary key of nested object (A) somehow to disable its primary-keyness in the nesting class (B)? Thanks. David - To unsubsc

Re: (xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
B Users List" <[EMAIL PROTECTED]> Odesláno: 28. cervna 2004 12:07 Predmet: Re: (xdoclet -> torque) with reference to interface > David Zejda wrote: > > >Do I need factory-class/factory-method if I have ojbConcreteClass? > >I thougt, if the ojbConcreteClass is provi

Re: (xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
/viewcvs.cgi/*checkout*/db-ojb/lib/xdoclet-ojb-module-1.2.1.jar http://cvs.apache.org/viewcvs.cgi/*checkout*/db-ojb/lib/xjavadoc-1.0.3.jar , other libs are from rc6. Should I try OJB rc7? Or current snapshot of whole OJB? Thanks David > David Zejda wrote: > > >Remains roughly the same.

Re: (xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
> Generating repository descriptors for interfaces works without problems, > but you should be aware of some things when using this at runtime. E.g. > you probably need factory-class/factory-method and perhaps ojbConcreteClass. Do I need factory-class/factory-method if I have ojbConcreteClass? I t

Re: (xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
-> torque) with reference to interface > David Zejda wrote: > > >I provided several (cca 20) more xdoclet ojb.class tags and appropriate > >ojb.fields, ojb.collections, ojb.references... Repository is being created > >OK, but the torque schema fails. I'm not sure, wh

Re: storing objects with nested objects

2004-06-28 Thread David Zejda
I guess, auto-update="true" may help. David - Puvodní zpráva - Od: "Morley, Liam " <[EMAIL PROTECTED]> Komu: "OJB Users List" <[EMAIL PROTECTED]> Odesláno: 27. cervna 2004 9:01 Predmet: storing objects with nested objects I have 3 separate objects: A, B, and C. A has a collection of B,

Re: (xdoclet -> torque) with reference to interface

2004-06-28 Thread David Zejda
Odesláno: 26. cervna 2004 20:20 Predmet: Re: (xdoclet -> torque) with reference to interface > David Zejda wrote: > > > I had a class with reference: > > > > * @ojb.reference class-ref="oit.agree.Agreement" > > *foreignkey="

(xdoclet -> torque) with reference to interface

2004-06-26 Thread David Zejda
I had a class with reference: * @ojb.reference class-ref="oit.agree.Agreement" *foreignkey="agreement_id" *auto-retrieve="true" *auto-update="false" *auto-delete="false" and referenced interface (with no ojb

1:n bidirectional

2004-06-25 Thread David Zejda
Is it possible, to have a ? With this repos (produced from XDoclet) it throws "Integrity constraint violation": Thanks for your suggestions.. David - To unsubscri

constantly evolving project

2004-06-11 Thread David Zejda
I have a project, where both object and relational model changes with a new release. Currently I use XDoclet to generate both repository and SQL (via Torque). Is there any way to generate SQL DDL able to update table structures to accomodate them to a new object model, preserving data? Or should I

HSQLDB + DATE type

2004-06-09 Thread David Zejda
I have a class Email /** * @ojb.field */ private Date date; ... transformed into repository and after calling broker.store() it says: SQL failure while insert object data for class oit.Email, PK of the given object is [ id=1], object was [EMAIL PROTECTED], exception mess

override default row reader

2004-06-03 Thread David Zejda
is it possible to specify custom row reader for a whole project or for a connection? thanks David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]