Discussion:
[Middlegen-user] Bug in middlegen?
Andreas Langman
2002-04-09 09:41:33 UTC
Permalink
Hello,

i have a Table "Aktivitaet"
it has two relationship fields to the same Table Uebergang
(Vorgaenger and Nachfolger)

Middlegen generates one relation with two target column maps instead of
two relations with one column map.

/**
* Returns a collection of local Uebergang
*
* @return a collection of local Uebergang
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="f_uebergang-f_aktivitaet"
* role-name="f_aktivitaet-has-f_uebergang"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* @weblogic:target-column-map
* foreign-key-column="AKTI_NACHFOLGER_ID"
* key-column="UEBE_ID"
* @weblogic:target-column-map
* foreign-key-column="AKTI_VORGAENGER_ID"
* key-column="UEBE_ID"
*
*/

i need the following

/**
* Returns a collection of local Uebergang
*
* @return a collection of local Uebergang
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="f_uebergang-f_aktivitaet-AKTI_NACHFOLGER_ID"
* role-name="f_aktivitaet-has-f_uebergang-AKTI_NACHFOLGER_ID"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* @weblogic:target-column-map
* foreign-key-column="AKTI_NACHFOLGER_ID"
* key-column="UEBE_ID"
*
*/

/**
* Returns a collection of local Uebergang
*
* @return a collection of local Uebergang
*
* @ejb:interface-method view-type="local"
*
* @ejb:relation
* name="f_uebergang-f_aktivitaet-AKTI_VORGAENGER_ID"
* role-name="f_aktivitaet-has-f_uebergang-AKTI_VORGAENGER_ID"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* @weblogic:target-column-map
* foreign-key-column="AKTI_VORGAENGER_ID"
* key-column="UEBE_ID"
*
*/
Aslak Hellesoy
2002-04-09 17:54:25 UTC
Permalink
I hadn't thought about this one really. The thing is that in WLS one
relationship can consist of several column-maps. Here is from the DTD:
<!ELEMENT weblogic-relationship-role (
relationship-role-name,
group-name?,
column-map*,
db-cascade-delete?
)>

Currently all db field references will be aggreagated into one relationship
role. I understand that in some cases (like yours) the intent is to have
several relationship roles, each one of them aggregating only one column
map. The problem is: How can Middlegen decide which case applies?

I'm not sure, but I think most app server vendors only support one mapping
per relation (i.e. one pair of fk and pk per relation), so it makes sense to
do it your way. I still think Middlegen should support both, but I'm not
sure. If there are n refs between two tables, this gives us a lot of
combinations. Consider this:

FOO BAR
+-----+ a-d +-----+
| a + ----- + d |
+-----+ b-e +-----+
| b + ----- + e |
+-----+ c-f +-----+
| c + ----- + f |
+-----+ +-----+

Middlegen generates this:

FOO-BAR (a-d,b-e,c-f)
FOO-BAR (a-d)
FOO-BAR (b-e)
FOO-BAR (c-f)

And doesn't generate this:
FOO-BAR (a-d,b-e)
FOO-BAR (b-e,c-f)
FOO-BAR (c-f,a-d)

This raises some issues:
-How do we display this in the GUI? Like this?

FOO --------- BAR
+-----+ +-----+
| a + ----- + d |
+-----+ +-----+
| b + ----- + e |
+-----+ +-----+
| c + ----- + f |
+-----+ +-----+

The top line represents the relation which represents the (a-d,b-e,c-f)
mapping. The user can then remove the directionality on the ones that are
not desired.

Let me know what you think.

/Aslak
-----Original Message-----
Langman
Sent: 9. april 2002 13:41
Subject: [Middlegen-user] Bug in middlegen?
Hello,
i have a Table "Aktivitaet"
it has two relationship fields to the same Table Uebergang
(Vorgaenger and Nachfolger)
Middlegen generates one relation with two target column maps instead of
two relations with one column map.
/**
* Returns a collection of local Uebergang
*
*
*
* name="f_uebergang-f_aktivitaet"
* role-name="f_aktivitaet-has-f_uebergang"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* foreign-key-column="AKTI_NACHFOLGER_ID"
* key-column="UEBE_ID"
* foreign-key-column="AKTI_VORGAENGER_ID"
* key-column="UEBE_ID"
*
*/
i need the following
/**
* Returns a collection of local Uebergang
*
*
*
* name="f_uebergang-f_aktivitaet-AKTI_NACHFOLGER_ID"
* role-name="f_aktivitaet-has-f_uebergang-AKTI_NACHFOLGER_ID"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* foreign-key-column="AKTI_NACHFOLGER_ID"
* key-column="UEBE_ID"
*
*/
/**
* Returns a collection of local Uebergang
*
*
*
* name="f_uebergang-f_aktivitaet-AKTI_VORGAENGER_ID"
* role-name="f_aktivitaet-has-f_uebergang-AKTI_VORGAENGER_ID"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* foreign-key-column="AKTI_VORGAENGER_ID"
* key-column="UEBE_ID"
*
*/
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Andreas Langman
2002-04-10 05:03:07 UTC
Permalink
That would be perfect for our needs. One Relationship with many mappings
dont work with Weblogic. I need one "getOtherSide" for each mapping. The
Relation names could be a problem.... maybe the foreign key field name
should be included.
Post by Aslak Hellesoy
I hadn't thought about this one really. The thing is that in WLS one
<!ELEMENT weblogic-relationship-role (
relationship-role-name,
group-name?,
column-map*,
db-cascade-delete?
)>
Currently all db field references will be aggreagated into one relationship
role. I understand that in some cases (like yours) the intent is to have
several relationship roles, each one of them aggregating only one column
map. The problem is: How can Middlegen decide which case applies?
I'm not sure, but I think most app server vendors only support one mapping
per relation (i.e. one pair of fk and pk per relation), so it makes sense to
do it your way. I still think Middlegen should support both, but I'm not
sure. If there are n refs between two tables, this gives us a lot of
FOO BAR
+-----+ a-d +-----+
| a + ----- + d |
+-----+ b-e +-----+
| b + ----- + e |
+-----+ c-f +-----+
| c + ----- + f |
+-----+ +-----+
FOO-BAR (a-d,b-e,c-f)
FOO-BAR (a-d)
FOO-BAR (b-e)
FOO-BAR (c-f)
FOO-BAR (a-d,b-e)
FOO-BAR (b-e,c-f)
FOO-BAR (c-f,a-d)
-How do we display this in the GUI? Like this?
FOO --------- BAR
+-----+ +-----+
| a + ----- + d |
+-----+ +-----+
| b + ----- + e |
+-----+ +-----+
| c + ----- + f |
+-----+ +-----+
The top line represents the relation which represents the (a-d,b-e,c-f)
mapping. The user can then remove the directionality on the ones that are
not desired.
Let me know what you think.
/Aslak
-----Original Message-----
Langman
Sent: 9. april 2002 13:41
Subject: [Middlegen-user] Bug in middlegen?
Hello,
i have a Table "Aktivitaet"
it has two relationship fields to the same Table Uebergang
(Vorgaenger and Nachfolger)
Middlegen generates one relation with two target column maps instead of
two relations with one column map.
/**
* Returns a collection of local Uebergang
*
*
*
* name="f_uebergang-f_aktivitaet"
* role-name="f_aktivitaet-has-f_uebergang"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* foreign-key-column="AKTI_NACHFOLGER_ID"
* key-column="UEBE_ID"
* foreign-key-column="AKTI_VORGAENGER_ID"
* key-column="UEBE_ID"
*
*/
i need the following
/**
* Returns a collection of local Uebergang
*
*
*
* name="f_uebergang-f_aktivitaet-AKTI_NACHFOLGER_ID"
* role-name="f_aktivitaet-has-f_uebergang-AKTI_NACHFOLGER_ID"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* foreign-key-column="AKTI_NACHFOLGER_ID"
* key-column="UEBE_ID"
*
*/
/**
* Returns a collection of local Uebergang
*
*
*
* name="f_uebergang-f_aktivitaet-AKTI_VORGAENGER_ID"
* role-name="f_aktivitaet-has-f_uebergang-AKTI_VORGAENGER_ID"
* target-ejb="Uebergang"
* target-role-name="f_uebergang-has-f_aktivitaet"
* target-multiple="yes"
*
*
* foreign-key-column="AKTI_VORGAENGER_ID"
* key-column="UEBE_ID"
*
*/
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Andreas Langman
2002-04-10 06:26:05 UTC
Permalink
Help!

my build-script says, there is no weblogic subtask in ejbdoclet task
!!!!!!!!!!!!!!!!!!!!!!!!!

(i have updated to newest middlegen cvs version)

thanks,

Andreas Langmann
a***@netcom.no
2002-04-10 07:36:05 UTC
Permalink
Update again and see if it works. If it doesn't I must have forgotten
to commit something last night, The weblogic not found will happen if
you don't have weblogic-optional.jar (from xdoclet) in your lib
directory. I'll check this when I get home.

----- Original Message -----
From: Andreas Langman <***@isb-ag.de>
Date: Wednesday, April 10, 2002 10:25 am
Subject: [Middlegen-user] Middlegen update! Task not Found
Post by Andreas Langman
Help!
my build-script says, there is no weblogic subtask in ejbdoclet
task
!!!!!!!!!!!!!!!!!!!!!!!!!
(i have updated to newest middlegen cvs version)
thanks,
Andreas Langmann
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Aslak Hellesoy
2002-04-10 14:19:07 UTC
Permalink
Strange. I just did a fresh update, and it works fine. Can you try that too?

Aslak
-----Original Message-----
Sent: 10. april 2002 10:26
To: Aslak Hellesoy
Subject: Middlegen update! Task not Found
Help!
my build-script says, there is no weblogic subtask in ejbdoclet task
!!!!!!!!!!!!!!!!!!!!!!!!!
(i have updated to newest middlegen cvs version)
thanks,
Andreas Langmann
Loading...