db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Engelbert <c.engelb...@u-form.de>
Subject Re: Attibute modifications in schema
Date Fri, 01 Oct 2010 15:41:16 GMT

> I'm not sure. JPA entities differ in behaviour from Torque objects very
> much We could use only a subset of JPA annotations (e.g. manytomany is not
> supported). Foreign keys concepts differ (Torque objects do know the
> foreign key plus the linked object, JPA objects only know the linked
> object). Besides, the licensing situation might be difficult (I did not
> check the JPA API license). I'd guess JPA annotations will either not work
> at all or prove very difficult to use.
> I do not understand the JAXB part. Torque annotations will be about
> database specifics (which columns will be written into the database, which
> colum is the primary key) and these concepts are not covered by JAXB.

I don't want to copy the JPA behaviour in Torque but since there are
annotations for tables, columns, datatypes ... you can annotate
fields the same way you use in JPA. ManyToMany is first introduced
in JPA 2.0 and for sure the behaviour is totally different but you
can use the annotations as a hint on how to convert the pojos to an
database schema, JPA does it as well.
And for sure it can be a subset of all of the annotations.
The same applies to JAXB annotations. There are annotations for
Elements (e.g tables) and Attributes (columns) - just as an example.

If non of both annotation sets are able to meet the requirements you
can add new annotations (similar to what hibernate or eclipselink
did for missing features of JPA 1.0).

But I would start on an already existing set of annotations to not
overload a pojo with annotations. One field with 20 annotations
isn't easier to handle than writing the xml :)

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message