Discussion:
[Middlegen-user] Foreign key finders
hari babu
2003-01-14 06:25:10 UTC
Permalink
hai friends,

I have got two tables A and B.

Table A has columns ID, Name, Age(_ primary key ID)

Table B Has columns UID, ID, rank. Here ID is the Foreign key referencing ID in table A. I have a column ID physically in Table B.

Now when i generate code from middlegen i am not getting finder method for ID in table B's entity.

I have set fkcmp=false attribute in the build file.

How can i get the finder for the foreign key?

is there any workaround.



Hari Babu





---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
Aslak Hellesoy
2003-01-14 07:24:02 UTC
Permalink
I intentionally removed finders for fks, because I believe it is bad design
to use them. FKs should have no business meaning, and shouldn't be exposed.
You can find by ID in the A table and then do a.getBs() to obtain the same
result. Would this work for you?

(Could you please send ASCII mail?)

Aslak

-----Original Message-----
From: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]On Behalf Of hari babu
Sent: 14. januar 2003 09:25
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] Foreign key finders


hai friends,
I have got two tables A and B.
Table A has columns ID, Name, Age(_ primary key ID)
Table B Has columns UID, ID, rank. Here ID is the Foreign key referencing ID
in table A. I have a column ID physically in Table B.
Now when i generate code from middlegen i am not getting finder method for
ID in table B's entity.
I have set fkcmp=false attribute in the build file.
How can i get the finder for the foreign key?
is there any workaround.

Hari Babu





Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
hari babu
2003-01-16 07:06:04 UTC
Permalink
hai,
thanks for ur reply.
sorry for not sending in ascii format.
i have changed now.
Aslak,
Its all ok that FK should not have any business
meaning. But i have that column physically in my
table.
And also i have a very important function based on the
finder for that FK. Is there any way to get finders
for foreign key. I think its nt harmful to have it.

I am sorry that i cant understand this statement
technically
' YOU CAN FIND BY ID ON TABLE A AND THEN FO
A.GETBs()'.
can u explain briefly what u meant?

Hari Babu












Aslak_Hellesoy wrote:I intentionally removed finders
for fks, because I believe it is bad designto use
them. FKs should have no business meaning, and
shouldn't be exposed.You can find by ID in the A table
and then do a.getBs() to obtain the sameresult. Would
this work for you?(Could you please send ASCII
mail?)Aslak-----Original Message-----From:
middlegen-user-***@lists.sourceforge.net[mailto:middlegen-user-***@lists.sourceforge.net]On
Behalf Of hari babuSent: 14. januar 2003 09:25To:
middlegen-***@lists.sourceforge.netSubject:
[Middlegen-user] Foreign key findershai friends,I have
got two tables A and B.Table A has columns ID, Name,
Age(_ primary key ID)Table B Has columns UID, ID,
rank. Here ID is the Foreign key referencing IDin
table A. I have a column ID physically in Table B.Now
when i generate code from middlegen i am not getting
finder method forID in table B's entity.I have set
fkcmp=false attribute in the build file.How can i get
the finder for the foreign key?is there any
workaround.Hari BabuDo you Yahoo!?New DSL Internet
Access from SBC & Yahoo!

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
hari babu
2003-01-16 09:51:11 UTC
Permalink
thanks aslak,
i got it!!!!!!!
i can do findByID on A and then call a.getBs() to
satisfy my requirements!!

Thanks again for ur help.

Hari Babu
Post by Aslak Hellesoy
I intentionally removed finders for fks, because I
believe it is bad design
to use them. FKs should have no business meaning,
and shouldn't be exposed.
You can find by ID in the A table and then do
a.getBs() to obtain the same
result. Would this work for you?
(Could you please send ASCII mail?)
Aslak
-----Original Message-----
Behalf Of hari babu
Sent: 14. januar 2003 09:25
Subject: [Middlegen-user] Foreign key finders
hai friends,
I have got two tables A and B.
Table A has columns ID, Name, Age(_ primary key ID)
Table B Has columns UID, ID, rank. Here ID is the
Foreign key referencing ID
in table A. I have a column ID physically in Table
B.
Now when i generate code from middlegen i am not
getting finder method for
ID in table B's entity.
I have set fkcmp=false attribute in the build file.
How can i get the finder for the foreign key?
is there any workaround.
Hari Babu
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
a***@netcom.no
2003-01-16 20:42:03 UTC
Permalink
Post by hari babu
thanks aslak,
i got it!!!!!!!
i can do findByID on A and then call a.getBs() to
satisfy my requirements!!
Thanks again for ur help.
bingo! ;-)

aslak

Loading...