Discussion:
[Middlegen-user] Many to many relations
Lisa M Arthur
2002-04-22 07:33:04 UTC
Permalink
Hi,

we want to generate a many to amny relation using middlegen, but don't want
it to generate the joint-table. E.g. Contract - Company have a many to many
relation with a jointtable in the database called Contract_Company.
Middlegen generates a ContractBean, CompanyBean and a ContractCompanyBean
where Contract has a relation to ContractCompany with a collection of
ContractCompanies, ContractCompany has relations to Contract and Company
with one Contract and one Company and Company has a relation to
ContractCompany with a collection of ContractCompanies. This is not what we
want.

What we want is that there should be a ContractBean and a CompanyBean where
ContractBean should have a relation to CompanyBean with a Collection of
Companies and Company should have a relation to Contract with a collection
of contracts and a joint_table should be specified in both. Like the example
below taken from the samples in XDoclet 1.1.2:

In CityBean:

/**
* @return all languages of this city
*
* @ejb:interface-method view-type="local"
* @ejb:transaction type="Supports"
* @ejb:relation
* name="language-city"
* role-name="many-city-has-many-language"
*
* @weblogic:relation
* join-table-name="LANGUAGE_CITY"
*
* @weblogic:column-map
* foreign-key-column="language_id_fk"
* key-column="language_id"
*/


In LanguageBean:

/**
* @return all cities of this language
*
* @ejb:interface-method view-type="local"
* @ejb:relation
* name="language-city"
* role-name="many-language-has-many-city"
*
* @weblogic:relation
* join-table-name="LANGUAGE_CITY"
*
* @weblogic:column-map
* foreign-key-column="city_id_fk"
* key-column="city_id"
*/

If it is possible for middlegen to do this, can someone please explain what
we have to do?

We are using middlegen from CVS with the tag: BEFORE_CLASSTYPE_REFACTORING
and the xdoclet version included in this, and Oracle8i.

Thanks,

Lisa and Freddy
Aslak Hellesøy
2002-04-22 19:26:02 UTC
Permalink
Hi!

I have committed some experimental support for m:n relations to the HEAD
branch (which should be more stable now, so I suggest you revert to that).
See the samples/build.xml for an example about how to use it (set
many2many="true" in middlegen task)

There are some problems though:
-unidirectional m:n relationships cause xdoclet to throw an exception during
generation of weblogic-cmp-rdbms-jar.xml.
-bidirectional m:n relationships seem to pass OK in xdoclet, but ejbc will
choke.

So there is some debugging to be done on the @tag level (in middlegen or
xdoclet - don't know where yet). At least the java code is correct...

Try it out and let me know how it goes. If you get the same symptoms as me
and decide to "hand-fix" the weblogic-cmp-rdbms-jar.xml so that ejbc accepts
it, it would be great if you could send me the xdoclet-generated
weblogic-cmp-rdbms-jar.xml and the hand-modified one. It would make it
easier for me to fix the bug(s)

Cheers,
Aslak
-----Original Message-----
Arthur
Sent: 22. april 2002 11:30
Subject: [Middlegen-user] Many to many relations
Hi,
we want to generate a many to amny relation using middlegen, but
don't want
it to generate the joint-table. E.g. Contract - Company have a
many to many
relation with a jointtable in the database called Contract_Company.
Middlegen generates a ContractBean, CompanyBean and a ContractCompanyBean
where Contract has a relation to ContractCompany with a collection of
ContractCompanies, ContractCompany has relations to Contract and Company
with one Contract and one Company and Company has a relation to
ContractCompany with a collection of ContractCompanies. This is
not what we
want.
What we want is that there should be a ContractBean and a
CompanyBean where
ContractBean should have a relation to CompanyBean with a Collection of
Companies and Company should have a relation to Contract with a collection
of contracts and a joint_table should be specified in both. Like
the example
/**
*
* name="language-city"
* role-name="many-city-has-many-language"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="language_id_fk"
* key-column="language_id"
*/
/**
*
* name="language-city"
* role-name="many-language-has-many-city"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="city_id_fk"
* key-column="city_id"
*/
If it is possible for middlegen to do this, can someone please
explain what
we have to do?
We are using middlegen from CVS with the tag: BEFORE_CLASSTYPE_REFACTORING
and the xdoclet version included in this, and Oracle8i.
Thanks,
Lisa and Freddy
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Lisa M Arthur
2002-04-23 09:57:02 UTC
Permalink
Hi,

we've started trying this out and get different errors with different
versions of XDoclet (we tried out different versions just in case :) ), so
we'd like to know which version we should be using?

Thanks,

Lisa and Freddy

-----Original Message-----
From: Aslak Hellesøy [mailto:***@netcom.no]
Sent: 22. april 2002 23:25
To: Lisa M Arthur; middlegen-***@lists.sourceforge.net
Subject: RE: [Middlegen-user] Many to many relations


Hi!

I have committed some experimental support for m:n relations to the HEAD
branch (which should be more stable now, so I suggest you revert to that).
See the samples/build.xml for an example about how to use it (set
many2many="true" in middlegen task)

There are some problems though:
-unidirectional m:n relationships cause xdoclet to throw an exception during
generation of weblogic-cmp-rdbms-jar.xml.
-bidirectional m:n relationships seem to pass OK in xdoclet, but ejbc will
choke.

So there is some debugging to be done on the @tag level (in middlegen or
xdoclet - don't know where yet). At least the java code is correct...

Try it out and let me know how it goes. If you get the same symptoms as me
and decide to "hand-fix" the weblogic-cmp-rdbms-jar.xml so that ejbc accepts
it, it would be great if you could send me the xdoclet-generated
weblogic-cmp-rdbms-jar.xml and the hand-modified one. It would make it
easier for me to fix the bug(s)

Cheers,
Aslak
-----Original Message-----
Arthur
Sent: 22. april 2002 11:30
Subject: [Middlegen-user] Many to many relations
Hi,
we want to generate a many to amny relation using middlegen, but
don't want
it to generate the joint-table. E.g. Contract - Company have a
many to many
relation with a jointtable in the database called Contract_Company.
Middlegen generates a ContractBean, CompanyBean and a ContractCompanyBean
where Contract has a relation to ContractCompany with a collection of
ContractCompanies, ContractCompany has relations to Contract and Company
with one Contract and one Company and Company has a relation to
ContractCompany with a collection of ContractCompanies. This is
not what we
want.
What we want is that there should be a ContractBean and a
CompanyBean where
ContractBean should have a relation to CompanyBean with a Collection of
Companies and Company should have a relation to Contract with a collection
of contracts and a joint_table should be specified in both. Like
the example
/**
*
* name="language-city"
* role-name="many-city-has-many-language"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="language_id_fk"
* key-column="language_id"
*/
/**
*
* name="language-city"
* role-name="many-language-has-many-city"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="city_id_fk"
* key-column="city_id"
*/
If it is possible for middlegen to do this, can someone please
explain what
we have to do?
We are using middlegen from CVS with the tag: BEFORE_CLASSTYPE_REFACTORING
and the xdoclet version included in this, and Oracle8i.
Thanks,
Lisa and Freddy
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
a***@netcom.no
2002-04-23 10:50:04 UTC
Permalink
Until we (I have a new team member, Eivind Waaler) release the next
version of Middlegen, you should always use xdoclet.jar, xjavadoc.jar
and weblogic-module.jar from Middlegen CVS. As we work on Middlegen, we
regularly build those jars from the xdoclet CVS and put them in
Middlegen CVS. Why? Because we sometimes have to fix XDoclet while we
work on Middlegen.

FYI: Middlegen 1.2 will be released shortly after the next xdoclet
version is released. That's probably within a time-frame of 2-4 weeks.

/Aslak

----- Original Message -----
From: "Lisa M Arthur" <***@logit-systems.com>
Date: Tuesday, April 23, 2002 1:53 pm
Subject: RE: [Middlegen-user] Many to many relations
Post by Lisa M Arthur
Hi,
we've started trying this out and get different errors with different
versions of XDoclet (we tried out different versions just in case
:) ), so
we'd like to know which version we should be using?
Thanks,
Lisa and Freddy
-----Original Message-----
Sent: 22. april 2002 23:25
Subject: RE: [Middlegen-user] Many to many relations
Hi!
I have committed some experimental support for m:n relations to
the HEAD
branch (which should be more stable now, so I suggest you revert
to that).
See the samples/build.xml for an example about how to use it (set
many2many="true" in middlegen task)
-unidirectional m:n relationships cause xdoclet to throw an
exception during
generation of weblogic-cmp-rdbms-jar.xml.
-bidirectional m:n relationships seem to pass OK in xdoclet, but
ejbc will
choke.
middlegen or
xdoclet - don't know where yet). At least the java code is correct...
Try it out and let me know how it goes. If you get the same
symptoms as me
and decide to "hand-fix" the weblogic-cmp-rdbms-jar.xml so that
ejbc accepts
it, it would be great if you could send me the xdoclet-generated
weblogic-cmp-rdbms-jar.xml and the hand-modified one. It would
make it
easier for me to fix the bug(s)
Cheers,
Aslak
-----Original Message-----
Lisa M
Arthur
Sent: 22. april 2002 11:30
Subject: [Middlegen-user] Many to many relations
Hi,
we want to generate a many to amny relation using middlegen, but
don't want
it to generate the joint-table. E.g. Contract - Company have a
many to many
relation with a jointtable in the database called Contract_Company.
Middlegen generates a ContractBean, CompanyBean and a
ContractCompanyBean> where Contract has a relation to
ContractCompany with a collection of
ContractCompanies, ContractCompany has relations to Contract and
Company> with one Contract and one Company and Company has a
relation to
ContractCompany with a collection of ContractCompanies. This is
not what we
want.
What we want is that there should be a ContractBean and a
CompanyBean where
ContractBean should have a relation to CompanyBean with a
Collection of
Companies and Company should have a relation to Contract with a
collection> of contracts and a joint_table should be specified in
both. Like
the example
/**
*
* name="language-city"
* role-name="many-city-has-many-language"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="language_id_fk"
* key-column="language_id"
*/
/**
*
* name="language-city"
* role-name="many-language-has-many-city"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="city_id_fk"
* key-column="city_id"
*/
If it is possible for middlegen to do this, can someone please
explain what
we have to do?
BEFORE_CLASSTYPE_REFACTORING> and the xdoclet version included in
this, and Oracle8i.
Thanks,
Lisa and Freddy
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Lisa M Arthur
2002-04-24 07:28:04 UTC
Permalink
We've tried out manytomany with middlegen, both unidirectional and
bidirectional,(Using the middlegen HEAD as suggested and the xdoclet,
xjavadoc, weblogic-module versions included with it) but I'm not sure we got
the same problems as you said you had. Running XDoclet was no problem, but
when running the weblogic server we got:

<23.apr.02 13:33:35 CEST> <Error> <J2EE> <Error deploying application
ejbtcmstes
t:

Unable to deploy EJB: ejbtcmstest.jar from ejbtcmstest.jar:

The XML parser encountered an error in your deployment descriptor. Please
ensure
that your DOCTYPE is correct. You may wish to compare your deployment
descripto
rs with the WebLogic Server examples to ensure the format is correct. The
error
was:
weblogic.xml.process.SAXValidationException: Duplicate ejb name Company in
ejb-j
ar.xml
at
weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.__post_8(EjbJarLoader_EJB20.
java:2988)
at
weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.postProc(EjbJarLoader_EJB20.
java:1942)
at
weblogic.xml.process.ProcessorDriver.postProc(ProcessorDriver.java:19
4)
at
weblogic.xml.process.ProcessorDriver.endElement(ProcessorDriver.java:
88)..........

for both unidirectional and bidirectional.

Looking at the ejb-jar.xml and the other xml files it seems that xdoclet is
generating duplicate descriptions of the beans. For each bean there is two
<entity></entity> tags with the same content, this is what is causing the
error. Other entries are also duplicated in the different xml files. And the
<relationships> part in ejb-jar.xml looks like this:

1.

<!-- Relationships -->
<relationships >
<ejb-relation >
<ejb-relation-name>contract_type-contract-cmp</ejb-relation-name>

<ejb-relationship-role >

<ejb-relationship-role-name>contract-has-contract_type</ejb-relationship-rol
e-name>
<multiplicity>One</multiplicity>
<relationship-role-source >
<ejb-name>Contract</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>contractType</cmr-field-name>
</cmr-field>
</ejb-relationship-role>

<ejb-relationship-role >

<ejb-relationship-role-name>contract-has-contract_type</ejb-relationship-rol
e-name>
<multiplicity>One</multiplicity>
<relationship-role-source >
<ejb-name>Contract</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>contractType</cmr-field-name>
</cmr-field>
</ejb-relationship-role>

</ejb-relation>

2.

This is supposed to be the many-to-many relation, unidirectional:

<ejb-relation >
<ejb-relation-name>COMPANY-CONTRACT-cmp</ejb-relation-name>

<ejb-relationship-role >

<ejb-relationship-role-name>contract-has-company</ejb-relationship-role-name
<multiplicity>Many</multiplicity>
<relationship-role-source >
<ejb-name>Contract</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>companies</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>

<ejb-relationship-role >

<ejb-relationship-role-name>contract-has-company</ejb-relationship-role-name
<multiplicity>Many</multiplicity>
<relationship-role-source >
<ejb-name>Contract</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>companies</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>

</ejb-relation>
</relationships>

While in a version that works(using the BEFORE_CLASSTYPE_REFACTORING version
of middlegen and the xdoclet version included with it), the relation for
contract_type-contract (many-one) (1. above) looks like this:

<ejb-relation >
<ejb-relation-name>contract_type-contract</ejb-relation-name>

<ejb-relationship-role >

<ejb-relationship-role-name>contract-has-contract_type</ejb-relationship-rol
e-name>
<multiplicity>Many</multiplicity>
<relationship-role-source >
<ejb-name>Contract</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>contractType</cmr-field-name>
</cmr-field>
</ejb-relationship-role>

<ejb-relationship-role >

<ejb-relationship-role-name>contract_type-has-contract</ejb-relationship-rol
e-name>
<multiplicity>One</multiplicity>
<relationship-role-source >
<ejb-name>ContractType</ejb-name>
</relationship-role-source>
</ejb-relationship-role>

</ejb-relation>

This is from the tags generated by middlegen:

/**
* Returns a collection of local ContractType
*
* @return a collection of local ContractType
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="contract_type-contract"
* role-name="contract-has-contract_type"
* target-ejb="ContractType"
* target-role-name="contract_type-has-contract"
* target-multiple="yes"
*
*
* @weblogic:target-column-map
* foreign-key-column="C_T_ID"
* key-column="C_T_ID"
*
*/
public abstract middlegen.demo.ejb.ContractTypeLocal getContractType();

and it works just fine :)

These are the tags generated with the HEAD version of middlegen:


/**
* Returns a collection of local ContractType
*
* @return a collection of local ContractType
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="contract_type-contract-cmp"
* role-name="contract-has-contract_type"
* target-ejb="ContractType"
* target-role-name="contract_type-has-contract"
* target-multiple="yes"
*
*
* @weblogic:target-column-map
* foreign-key-column="C_T_ID"
* key-column="C_T_ID"
*
*/
public abstract middlegen.demo.ejb.ContractTypeLocal getContractType();

As they look exactly the same, the resulting entry in ejb-jar.xml should be
the same, which it is not(see 1.). So there must be something wrong with the
version of xdoclet included with the HEAD version of middlegen. We tried
getting a newer version of xdoclet(23.4), but got the same problem.

Hope this can help you fix the problems :)

The tags generated for our unidirectional many to many relation look like
this in Contract, where Company is the other table/bean and Contract_Company
the joint-table, the ejb-jar.xml entry for this relation was shown earlier
at 2.:


/**
* Returns a collection of local Companies
*
* @return a collection of local Companies
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="COMPANY-CONTRACT-cmp"
* role-name="contract-has-company"
* target-ejb="Company"
* target-role-name="company-has-contract"
* target-multiple="yes"
* @weblogic:relation
* join-table-name="CONTRACT_COMPANY"
*
*
* @weblogic:column-map
* foreign-key-column="CONTRACT_NO"
* key-column="CONTRACT_NO"
*
* @weblogic:target-column-map
* foreign-key-column="COMPANY_ID"
* key-column="COMPANY_ID"
*
* @jboss:relation
* fk-constraint="true"
* fk-column="CONTRACT_NO"
* related-pk-field="CONTRACT_NO"
*/

and I think that should work, so the problem might be xdoclet????

Hope this wasn't too confusing.

Lisa and Freddy


-----Original Message-----
From: ***@netcom.no [mailto:***@netcom.no]
Sent: 23. april 2002 14:49
To: Lisa M Arthur
Cc: middlegen-***@lists.sourceforge.net
Subject: Re: RE: [Middlegen-user] Many to many relations


Until we (I have a new team member, Eivind Waaler) release the next
version of Middlegen, you should always use xdoclet.jar, xjavadoc.jar
and weblogic-module.jar from Middlegen CVS. As we work on Middlegen, we
regularly build those jars from the xdoclet CVS and put them in
Middlegen CVS. Why? Because we sometimes have to fix XDoclet while we
work on Middlegen.

FYI: Middlegen 1.2 will be released shortly after the next xdoclet
version is released. That's probably within a time-frame of 2-4 weeks.

/Aslak

----- Original Message -----
From: "Lisa M Arthur" <***@logit-systems.com>
Date: Tuesday, April 23, 2002 1:53 pm
Subject: RE: [Middlegen-user] Many to many relations
Post by Lisa M Arthur
Hi,
we've started trying this out and get different errors with different
versions of XDoclet (we tried out different versions just in case
:) ), so
we'd like to know which version we should be using?
Thanks,
Lisa and Freddy
-----Original Message-----
Sent: 22. april 2002 23:25
Subject: RE: [Middlegen-user] Many to many relations
Hi!
I have committed some experimental support for m:n relations to
the HEAD
branch (which should be more stable now, so I suggest you revert
to that).
See the samples/build.xml for an example about how to use it (set
many2many="true" in middlegen task)
-unidirectional m:n relationships cause xdoclet to throw an
exception during
generation of weblogic-cmp-rdbms-jar.xml.
-bidirectional m:n relationships seem to pass OK in xdoclet, but
ejbc will
choke.
middlegen or
xdoclet - don't know where yet). At least the java code is correct...
Try it out and let me know how it goes. If you get the same
symptoms as me
and decide to "hand-fix" the weblogic-cmp-rdbms-jar.xml so that
ejbc accepts
it, it would be great if you could send me the xdoclet-generated
weblogic-cmp-rdbms-jar.xml and the hand-modified one. It would
make it
easier for me to fix the bug(s)
Cheers,
Aslak
-----Original Message-----
Lisa M
Arthur
Sent: 22. april 2002 11:30
Subject: [Middlegen-user] Many to many relations
Hi,
we want to generate a many to amny relation using middlegen, but
don't want
it to generate the joint-table. E.g. Contract - Company have a
many to many
relation with a jointtable in the database called Contract_Company.
Middlegen generates a ContractBean, CompanyBean and a
ContractCompanyBean> where Contract has a relation to
ContractCompany with a collection of
ContractCompanies, ContractCompany has relations to Contract and
Company> with one Contract and one Company and Company has a
relation to
ContractCompany with a collection of ContractCompanies. This is
not what we
want.
What we want is that there should be a ContractBean and a
CompanyBean where
ContractBean should have a relation to CompanyBean with a
Collection of
Companies and Company should have a relation to Contract with a
collection> of contracts and a joint_table should be specified in
both. Like
the example
/**
*
* name="language-city"
* role-name="many-city-has-many-language"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="language_id_fk"
* key-column="language_id"
*/
/**
*
* name="language-city"
* role-name="many-language-has-many-city"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="city_id_fk"
* key-column="city_id"
*/
If it is possible for middlegen to do this, can someone please
explain what
we have to do?
BEFORE_CLASSTYPE_REFACTORING> and the xdoclet version included in
this, and Oracle8i.
Thanks,
Lisa and Freddy
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Lisa M Arthur
2002-04-26 06:55:05 UTC
Permalink
Hi,

we've tried out many to many without using middlegen and got bidirectional
to work, but not unidirectional. Maybe this can help you implement it in
middlegen, if you haven't solved it already:

The relation is many to many between Contract and Company

ContractBean:


/**
* Returns a collection of local Companies
*
* @return a collection of local Companies
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="company-contract"
* role-name="contract-has-companies"
*
* @weblogic:relation
* join-table-name="CONTRACT_COMPANY"
*
* @weblogic:column-map
* foreign-key-column="COMPANY_ID"
* key-column="COMPANY_ID"
*/
public abstract java.util.Collection getCompanies();

/**
* Sets a collection of local Companies
*
* @ejb:interface-method view-type="local"
*
* @param companies a collection of local Companies
*/
public abstract void setCompanies(java.util.Collection companies);

CompanyBean:


/**
* Returns a collection of local Contracts
*
* @return a collection of local Contracts
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="company-contract"
* role-name="company-has-contracts"
*
* @weblogic:relation
* join-table-name="CONTRACT_COMPANY"
*
* @weblogic:column-map
* foreign-key-column="CONTRACT_NO"
* key-column="CONTRACT_NO"
*/
public abstract java.util.Collection getContracts();

/**
* Sets a collection of local Contracts
*
* @ejb:interface-method view-type="local"
*
* @param contracts a collection of local Contracts
*/
public abstract void setContracts(java.util.Collection contracts);



For unidirectional we tried this in ContractBean:

/**
* Returns a collection of local Companies
*
* @return a collection of local Companies
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="company-contract"
* role-name="contract-has-companies"
* target-ejb="Company"
* target-role-name="company-has-contracts"
* target-multiple="yes"
*
* @weblogic:relation
* join-table-name="CONTRACT_COMPANY"
*
* @weblogic:column-map
* foreign-key-column="COMPANY_ID"
* key-column="COMPANY_ID"
*
* @weblogic:target-column-map
* foreign-key-column="CONTRACT_NO"
* key-column="CONTRACT_NO"
*/
public abstract java.util.Collection getCompanies();

/**
* Sets a collection of local Companies
*
* @ejb:interface-method view-type="local"
*
* @param companies a collection of local Companies
*/
public abstract void setCompanies(java.util.Collection companies);

and got this error when running xdoclet:

[ejbdoclet] Generating weblogic-cmp-rdbms-jar.xml.
[ejbdoclet] (TemplateEngine.invokeMethod 604 ) Invoking method
failed: x
doclet.ejb.tags.vendor.WeblogicRelationTagsHandler.ifHasLeftGroupName,
line=6 of
template file:
jar:file:/C:/development/XDocletTestCVSMiddlegenManyToMany/lib/w
eblogic-module.jar!/xdoclet/optional/weblogic/ejb/resources/weblogic-cmp-rdb
ms-j
ar-xml.j
[ejbdoclet] java.lang.NullPointerException
[ejbdoclet] at
xdoclet.ejb.tags.vendor.WeblogicRelationTagsHandler.leftGroup
Name(WeblogicRelationTagsHandler.java:163)
[ejbdoclet] at
xdoclet.ejb.tags.vendor.WeblogicRelationTagsHandler.ifHasLeft
GroupName(WeblogicRelationTagsHandler.java:177)
[ejbdoclet] at java.lang.reflect.Method.invoke(Native Method)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:71
9)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.j
ava:594)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEng
ine.java:1037)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine
.java:1001)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java
:539)
[ejbdoclet] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:
427)
[ejbdoclet] at
xdoclet.template.TemplateTagHandler.generate(TemplateTagHandl
er.java:76)
[ejbdoclet] at
xdoclet.ejb.tags.RelationTagsHandler.ifIsMany2Many(RelationTa
gsHandler.java:522)
[ejbdoclet] at java.lang.reflect.Method.invoke(Native Method)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:71
9)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.j
ava:594)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEng
ine.java:1037)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine
.java:1001)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java
:539)
[ejbdoclet] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:
427)
[ejbdoclet] at
xdoclet.template.TemplateTagHandler.generate(TemplateTagHandl
er.java:76)
[ejbdoclet] at
xdoclet.ejb.tags.RelationTagsHandler.forAllRelationships(Rela
tionTagsHandler.java:321)
[ejbdoclet] at java.lang.reflect.Method.invoke(Native Method)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:71
9)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.j
ava:594)
[ejbdoclet] java.lang.RuntimeException: Error running XDoclet
[ejbdoclet] at xdoclet.XDocletMain.start(XDocletMain.java:77)
[ejbdoclet] at xjavadoc.ant.XJavaDocMain.main(XJavaDocMain.java:187)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEng
ine.java:1037)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine
.java:1001)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java
:539)
[ejbdoclet] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:
427)
[ejbdoclet] at
xdoclet.template.TemplateTagHandler.generate(TemplateTagHandl
er.java:76)
[ejbdoclet] at
xdoclet.tags.ConfigTagsHandler.ifConfigParamGreaterOrEquals(C
onfigTagsHandler.java:342)
[ejbdoclet] at java.lang.reflect.Method.invoke(Native Method)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:71
9)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.j
ava:594)
[ejbdoclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEng
ine.java:1037)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine
.java:1001)
[ejbdoclet] at
xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java
:539)
[ejbdoclet] at
xdoclet.template.TemplateEngine.generate(TemplateEngine.java:
427)
[ejbdoclet] at
xdoclet.template.TemplateEngine.start(TemplateEngine.java:483
)
[ejbdoclet] at
xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:786)

[ejbdoclet] at
xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:596
)
[ejbdoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:243)
[ejbdoclet] at
xdoclet.optional.weblogic.ejb.WebLogicSubTask.execute(WebLogi
cSubTask.java:200)
[ejbdoclet] at xdoclet.XDocletMain.start(XDocletMain.java:54)
[ejbdoclet] at xjavadoc.ant.XJavaDocMain.main(XJavaDocMain.java:187)
[ejbdoclet] Running XDoclet failed
[ejbdoclet] <<Running XDoclet failed.>>

This is using the version of xdoclet included with the
BEFORE_CLASSTYPE_REFACTORING version of middlegen from cvs 18.04.02.

Hope this can help you fix it or that it's already fixed :)

Lisa and Freddy


-----Original Message-----
From: ***@netcom.no [mailto:***@netcom.no]
Sent: 23. april 2002 14:49
To: Lisa M Arthur
Cc: middlegen-***@lists.sourceforge.net
Subject: Re: RE: [Middlegen-user] Many to many relations


Until we (I have a new team member, Eivind Waaler) release the next
version of Middlegen, you should always use xdoclet.jar, xjavadoc.jar
and weblogic-module.jar from Middlegen CVS. As we work on Middlegen, we
regularly build those jars from the xdoclet CVS and put them in
Middlegen CVS. Why? Because we sometimes have to fix XDoclet while we
work on Middlegen.

FYI: Middlegen 1.2 will be released shortly after the next xdoclet
version is released. That's probably within a time-frame of 2-4 weeks.

/Aslak

----- Original Message -----
From: "Lisa M Arthur" <***@logit-systems.com>
Date: Tuesday, April 23, 2002 1:53 pm
Subject: RE: [Middlegen-user] Many to many relations
Post by Lisa M Arthur
Hi,
we've started trying this out and get different errors with different
versions of XDoclet (we tried out different versions just in case
:) ), so
we'd like to know which version we should be using?
Thanks,
Lisa and Freddy
-----Original Message-----
Sent: 22. april 2002 23:25
Subject: RE: [Middlegen-user] Many to many relations
Hi!
I have committed some experimental support for m:n relations to
the HEAD
branch (which should be more stable now, so I suggest you revert
to that).
See the samples/build.xml for an example about how to use it (set
many2many="true" in middlegen task)
-unidirectional m:n relationships cause xdoclet to throw an
exception during
generation of weblogic-cmp-rdbms-jar.xml.
-bidirectional m:n relationships seem to pass OK in xdoclet, but
ejbc will
choke.
middlegen or
xdoclet - don't know where yet). At least the java code is correct...
Try it out and let me know how it goes. If you get the same
symptoms as me
and decide to "hand-fix" the weblogic-cmp-rdbms-jar.xml so that
ejbc accepts
it, it would be great if you could send me the xdoclet-generated
weblogic-cmp-rdbms-jar.xml and the hand-modified one. It would
make it
easier for me to fix the bug(s)
Cheers,
Aslak
-----Original Message-----
Lisa M
Arthur
Sent: 22. april 2002 11:30
Subject: [Middlegen-user] Many to many relations
Hi,
we want to generate a many to amny relation using middlegen, but
don't want
it to generate the joint-table. E.g. Contract - Company have a
many to many
relation with a jointtable in the database called Contract_Company.
Middlegen generates a ContractBean, CompanyBean and a
ContractCompanyBean> where Contract has a relation to
ContractCompany with a collection of
ContractCompanies, ContractCompany has relations to Contract and
Company> with one Contract and one Company and Company has a
relation to
ContractCompany with a collection of ContractCompanies. This is
not what we
want.
What we want is that there should be a ContractBean and a
CompanyBean where
ContractBean should have a relation to CompanyBean with a
Collection of
Companies and Company should have a relation to Contract with a
collection> of contracts and a joint_table should be specified in
both. Like
the example
/**
*
* name="language-city"
* role-name="many-city-has-many-language"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="language_id_fk"
* key-column="language_id"
*/
/**
*
* name="language-city"
* role-name="many-language-has-many-city"
*
* join-table-name="LANGUAGE_CITY"
*
* foreign-key-column="city_id_fk"
* key-column="city_id"
*/
If it is possible for middlegen to do this, can someone please
explain what
we have to do?
BEFORE_CLASSTYPE_REFACTORING> and the xdoclet version included in
this, and Oracle8i.
Thanks,
Lisa and Freddy
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...