----- Original Message -----
> Message: 5
> From: Andy Jefferson <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Organization: AJSoft Limited
> Date: 15 Jul 2003 17:46:43 +0100
> Subject: [Xdoclet-user] WebLogic : relationships
> Reply-To: [EMAIL PROTECTED]
>
> In attempting to generate weblogic deployment descriptors for EJB's I
> get a weblogic-ejb-jar.xml created successfully, yet I then encounter
> the insistence of xdoclet (1.2b3) that I need
>
> @weblogic:relation join-table-name="blabla"
>
> in my classes where there are relationships defined for EJB.
>
>
> My question is, why does xdoclet INSIST on this ?
Please provide examples of your tagged CMR fields.
>
> If you look at the EJB spec you find that the default behaviour is
> defined by ejb-jar.xml, and the parts like relationships in
> weblogic-cmp-rdbms.xml I think are optional. The default implementation
> is up to the J2EE container about join tables etc, so for example if I
> define my relationships in ejb-jar.xml ONLY I am leaving it up to the
> J2EE container to do what it feels like with regards foreign keys and
> join tables (for n to m relationships).
>The whole point of the changes
> in EJB 2.0 was to allow relationships and minimise the amount of effort
> expended in defining database links - hence the container defines
> methods of creating tables, and the methods of linking, for the user -
> and if they prefer they can still specify any foreign keys (for cases
> where they already have a DB model and need to map to it).
The EJB2.0 spec does not say anything about how entity beans are mapped to
tables. In fact the datastore doesn't even have to be a RDBMS. The spec
states that it is the responsibility of the "deployer" to map the abstract
schema to the physical schema. [Section 10.2]
>
> If I really HAVE to provide these 'link-table' names, what am I supposed
> to put in there ... any name I feel like ... the thing is, I want the
> container to create the table for me and handle all use of it so I
> really don't care what its called.
here's an example of M:N. i also had @ejb.persistence table-name="..."
defined at the class level for both CMP beans.
*/
* @ejb.interface-method view-type="local"
* @ejb.relation name="Author_Book_Rel"
* role-name="this_books_authors"
*
* @weblogic.relation join-table-name="AUTHOR_BOOK_REL"
* @weblogic.column-map foreign-key-column="ISBN"
* key-column="ISBN"
*/
public abstract Collection getAuthors();
*/
* @ejb.interface-method view-type="local"
* @ejb.relation name="Author_Book_Rel"
* role-name="this_authors_books"
*
* @weblogic.relation join-table-name="AUTHOR_BOOK_REL"
* @weblogic.column-map foreign-key-column="AUTHORID"
* key-column="ID"
*/
public abstract Collection getBooks();
lastly, you have to set the "createtables" attribute of the <weblogic/>
subtask to true if you want weblogic to create the tables. This will add a
<create-default-dbms-tables>True</create-default-dbms-tables> in your
weblogic-cmp-rdbms-jar.xml file. You may also have to specify the
database-type. Note this only works with supported databases, so check the
weblogic docs.
<weblogic version="7.0" xmlencoding="UTF-8"
destdir="classes/META-INF"
createtables="false"
validatexml="true"
validateDbSchemaWith="MetaData"
datasource="${datasource}"
databaseType="${db.type}"
mergedir="${merge.dir}"
persistence="weblogic"
/>
>
> My second question is, when xdoclet INSISTs that I have these tags, why
> does it not include this particular one (@weblogic.relation) in its
> documentation ?
Take a look at the older 1.1.2 docs, many of the tags are documented there.
You will have to look at the .xdt template files for anything else that is
missing.
>
>
> TIA
> --
> Andy
>
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user