Discussion:
AW: [Middlegen-user] Final S gets chopped in CMR methods
Meyer-Willner, Bernhard
2002-08-09 05:25:04 UTC
Permalink
Thanks a lot for your info. I already saw a feature request being added. I
still have two questions though:
1) Which table element do you mean? Is it in the preferences xml file?
2) The 'Middlegen smartness' would work fine for me, but in my case the two
accessors (setGla/getGla) which should have been (setGlas/getGlas) point to
a single instance - the methods take rsp. return a GlasLocal - so there was
no reason for Middlegen trying to pluralise. Rather it seems to me it
thought it was Plural (because of the final s) and therefore chopped it off.
Is my description correct and does the fixed Util class in CVS solve this
issue?

Thanks,
Bernhard


-----Ursprüngliche Nachricht-----
Von: Aslak Hellesøy [mailto:***@netcom.no]
Gesendet: Donnerstag, 8. August 2002 19:12
An: Meyer-Willner, Bernhard; middlegen-***@lists.sourceforge.net
Betreff: RE: [Middlegen-user] Final S gets chopped in CMR methods


Hi Bernhard,

Middlegen tries to be smart and pluralise or singularise english words,
depending on the cardinality. This is done in middlegen.Util.singularise()
and middlegen.Util.pluralise(). This code is not optimal, and even if it
were, it would never work for other languages.

I propose the following:
add two attributes to the <table> element where you can specify the desired
singular and plural form. Example:

<table name="toys" singular="toy" plural="toys"/>

If you like this approach, please submit a feature request. If you don't
maybe you have an other suggestion?

Cheers,
Aslak
-----Original Message-----
Meyer-Willner, Bernhard
Sent: 8. august 2002 15:30
Subject: [Middlegen-user] Final S gets chopped in CMR methods
Hi,
I wonder if this is a known issue. I have a bean called GlasBean (ejb-name
is Glas). Another bean has a one-to-one relationship with the GlasBean.
Problem is, the generated CMR accessors are named setGla and
getGla instead
of the appropriate setGlas and getGlas. I looked at the template and the
util methods and it seems there's some messing around going on with
adding/chopping S's depending on the cardinality of the relationship (s
added if multiplity is many). The generated one-to-many relationship
accessor names are all fine, as are all the other one-to-one accessors I
have. Can you tell me why the s gets chopped and maybe give me a hint to
work around this?
Thanks,
Bernie
---
Bernhard Meyer-Willner
Insurance - Financial Services
Logica GmbH
Alster City
Osterbekstrasse 90b
22083 Hamburg (Germany)
(+49) 40-27071-405
(+49) 177-425-9036
www.logica.de
This e-mail and any attachment is for authorised use by the
intended recipient(s) only. It may contain proprietary material,
confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any
other party. If you are not an intended recipient then please
promptly delete this e-mail and any attachment and all copies and
inform the sender. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Meyer-Willner, Bernhard
2002-08-09 05:45:04 UTC
Permalink
Already fixed my issue for now - quick and dirty -, by adjusting the
seemsPluralized method in Util. Still, always happy to receive an answer.
BTW, Middlegen is an awesome tool. It's been saving us a lot of time. I had
to change quite a few things though, since were reading our table and column
info from a database configuration table. It's been a bit hard in the
beginning to understand how the relationships and the directionality is set,
but I've already covered a lot of ground and so far we're quite satisfied
with the result.

Cheers,
Bernhard


-----Ursprüngliche Nachricht-----
Von: Meyer-Willner, Bernhard [mailto:Meyer-***@logica.com]
Gesendet: Freitag, 9. August 2002 09:25
An: 'Aslak Hellesøy'; middlegen-***@lists.sourceforge.net
Betreff: AW: [Middlegen-user] Final S gets chopped in CMR methods


Thanks a lot for your info. I already saw a feature request being added. I
still have two questions though:
1) Which table element do you mean? Is it in the preferences xml file?
2) The 'Middlegen smartness' would work fine for me, but in my case the two
accessors (setGla/getGla) which should have been (setGlas/getGlas) point to
a single instance - the methods take rsp. return a GlasLocal - so there was
no reason for Middlegen trying to pluralise. Rather it seems to me it
thought it was Plural (because of the final s) and therefore chopped it off.
Is my description correct and does the fixed Util class in CVS solve this
issue?

Thanks,
Bernhard


-----Ursprüngliche Nachricht-----
Von: Aslak Hellesøy [mailto:***@netcom.no]
Gesendet: Donnerstag, 8. August 2002 19:12
An: Meyer-Willner, Bernhard; middlegen-***@lists.sourceforge.net
Betreff: RE: [Middlegen-user] Final S gets chopped in CMR methods


Hi Bernhard,

Middlegen tries to be smart and pluralise or singularise english words,
depending on the cardinality. This is done in middlegen.Util.singularise()
and middlegen.Util.pluralise(). This code is not optimal, and even if it
were, it would never work for other languages.

I propose the following:
add two attributes to the <table> element where you can specify the desired
singular and plural form. Example:

<table name="toys" singular="toy" plural="toys"/>

If you like this approach, please submit a feature request. If you don't
maybe you have an other suggestion?

Cheers,
Aslak
-----Original Message-----
Meyer-Willner, Bernhard
Sent: 8. august 2002 15:30
Subject: [Middlegen-user] Final S gets chopped in CMR methods
Hi,
I wonder if this is a known issue. I have a bean called GlasBean (ejb-name
is Glas). Another bean has a one-to-one relationship with the GlasBean.
Problem is, the generated CMR accessors are named setGla and
getGla instead
of the appropriate setGlas and getGlas. I looked at the template and the
util methods and it seems there's some messing around going on with
adding/chopping S's depending on the cardinality of the relationship (s
added if multiplity is many). The generated one-to-many relationship
accessor names are all fine, as are all the other one-to-one accessors I
have. Can you tell me why the s gets chopped and maybe give me a hint to
work around this?
Thanks,
Bernie
---
Bernhard Meyer-Willner
Insurance - Financial Services
Logica GmbH
Alster City
Osterbekstrasse 90b
22083 Hamburg (Germany)
(+49) 40-27071-405
(+49) 177-425-9036
www.logica.de
This e-mail and any attachment is for authorised use by the
intended recipient(s) only. It may contain proprietary material,
confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any
other party. If you are not an intended recipient then please
promptly delete this e-mail and any attachment and all copies and
inform the sender. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
a***@netcom.no
2002-08-09 05:52:03 UTC
Permalink
----- Original Message -----
From: "Meyer-Willner, Bernhard" <Meyer-***@logica.com>
Date: Friday, August 9, 2002 9:24 am
Subject: AW: [Middlegen-user] Final S gets chopped in CMR methods
Post by Meyer-Willner, Bernhard
Thanks a lot for your info. I already saw a feature request being
added. I
1) Which table element do you mean? Is it in the preferences xml file?
The optional ones directly under tha <middlegen> task. See the
samples/build.xml file. Better docs will be out soon. A week or so.
Post by Meyer-Willner, Bernhard
2) The 'Middlegen smartness' would work fine for me, but in my
case the two
accessors (setGla/getGla) which should have been (setGlas/getGlas)
point to
a single instance - the methods take rsp. return a GlasLocal - so
there was
no reason for Middlegen trying to pluralise. Rather it seems to me it
thought it was Plural (because of the final s) and therefore
chopped it off.
Exactly. That's what it thought. People tend to name their tables in
plural (customers, orders etc.) so the current logic assumes something
is already plural if it ends with an s. Actually, it's a bit smarter -
ss is considered singular (glass, mess etc.)

Considering your case: What plurality can we expect an English word
ending in "as" to have? Should we make a spessial case for it like ss?
Or put differently: Are there any English words in singular form that
end with "as"? I don't think so. Therefore we can assume as is plural.
Shoot me if I'm wrong.

Example: (lemmas, auras : plural) I have a sneaky feeling this is latin
and not English.

Cheers,
Aslak
Post by Meyer-Willner, Bernhard
Is my description correct and does the fixed Util class in CVS
solve this
issue?
Nein. It nur understands English.
Post by Meyer-Willner, Bernhard
Thanks,
Bernhard
-----Urspr�ngliche Nachricht-----
Gesendet: Donnerstag, 8. August 2002 19:12
Betreff: RE: [Middlegen-user] Final S gets chopped in CMR methods
Hi Bernhard,
Middlegen tries to be smart and pluralise or singularise english
words,depending on the cardinality. This is done in
middlegen.Util.singularise()and middlegen.Util.pluralise(). This
code is not optimal, and even if it
were, it would never work for other languages.
add two attributes to the <table> element where you can specify
the desired
<table name="toys" singular="toy" plural="toys"/>
If you like this approach, please submit a feature request. If you
don'tmaybe you have an other suggestion?
Cheers,
Aslak
-----Original Message-----
Meyer-Willner, Bernhard
Sent: 8. august 2002 15:30
Subject: [Middlegen-user] Final S gets chopped in CMR methods
Hi,
I wonder if this is a known issue. I have a bean called GlasBean
(ejb-name
is Glas). Another bean has a one-to-one relationship with the
GlasBean.> Problem is, the generated CMR accessors are named
setGla and
getGla instead
of the appropriate setGlas and getGlas. I looked at the template
and the
util methods and it seems there's some messing around going on with
adding/chopping S's depending on the cardinality of the
relationship (s
added if multiplity is many). The generated one-to-many relationship
accessor names are all fine, as are all the other one-to-one
accessors I
have. Can you tell me why the s gets chopped and maybe give me a
hint to
work around this?
Thanks,
Bernie
---
Bernhard Meyer-Willner
Insurance - Financial Services
Logica GmbH
Alster City
Osterbekstrasse 90b
22083 Hamburg (Germany)
(+49) 40-27071-405
(+49) 177-425-9036
www.logica.de
This e-mail and any attachment is for authorised use by the
intended recipient(s) only. It may contain proprietary material,
confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any
other party. If you are not an intended recipient then please
promptly delete this e-mail and any attachment and all copies and
inform the sender. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
This e-mail and any attachment is for authorised use by the
intended recipient(s) only. It may contain proprietary material,
confidential information and/or be subject to legal privilege. It
should not be copied, disclosed to, retained or used by, any other
party. If you are not an intended recipient then please promptly
delete this e-mail and any attachment and all copies and inform
the sender. Thank you.
a***@netcom.no
2002-08-09 05:57:01 UTC
Permalink
----- Original Message -----
From: "Meyer-Willner, Bernhard" <Meyer-***@logica.com>
Date: Friday, August 9, 2002 9:44 am
Subject: AW: [Middlegen-user] Final S gets chopped in CMR methods
Post by Meyer-Willner, Bernhard
Already fixed my issue for now - quick and dirty -, by adjusting the
seemsPluralized method in Util. Still, always happy to receive an
Way to go. DTSTTCPW.
Post by Meyer-Willner, Bernhard
answer.BTW, Middlegen is an awesome tool. It's been saving us a
lot of time. I had
to change quite a few things though, since were reading our table
and column
info from a database configuration table. It's been a bit hard in the
Uh? So you've hacked your own MiddlegenPopulator sort of? Tell me more!

Aslak
Post by Meyer-Willner, Bernhard
beginning to understand how the relationships and the
directionality is set,
but I've already covered a lot of ground and so far we're quite
satisfiedwith the result.
Cheers,
Bernhard
-----Urspr�ngliche Nachricht-----
Gesendet: Freitag, 9. August 2002 09:25
Betreff: AW: [Middlegen-user] Final S gets chopped in CMR methods
Thanks a lot for your info. I already saw a feature request being
added. I
1) Which table element do you mean? Is it in the preferences xml file?
2) The 'Middlegen smartness' would work fine for me, but in my
case the two
accessors (setGla/getGla) which should have been (setGlas/getGlas)
point to
a single instance - the methods take rsp. return a GlasLocal - so
there was
no reason for Middlegen trying to pluralise. Rather it seems to me it
thought it was Plural (because of the final s) and therefore
chopped it off.
Is my description correct and does the fixed Util class in CVS
solve this
issue?
Thanks,
Bernhard
-----Urspr�ngliche Nachricht-----
Gesendet: Donnerstag, 8. August 2002 19:12
Betreff: RE: [Middlegen-user] Final S gets chopped in CMR methods
Hi Bernhard,
Middlegen tries to be smart and pluralise or singularise english
words,depending on the cardinality. This is done in
middlegen.Util.singularise()and middlegen.Util.pluralise(). This
code is not optimal, and even if it
were, it would never work for other languages.
add two attributes to the <table> element where you can specify
the desired
<table name="toys" singular="toy" plural="toys"/>
If you like this approach, please submit a feature request. If you
don'tmaybe you have an other suggestion?
Cheers,
Aslak
-----Original Message-----
Meyer-Willner, Bernhard
Sent: 8. august 2002 15:30
Subject: [Middlegen-user] Final S gets chopped in CMR methods
Hi,
I wonder if this is a known issue. I have a bean called GlasBean
(ejb-name
is Glas). Another bean has a one-to-one relationship with the
GlasBean.> Problem is, the generated CMR accessors are named
setGla and
getGla instead
of the appropriate setGlas and getGlas. I looked at the template
and the
util methods and it seems there's some messing around going on with
adding/chopping S's depending on the cardinality of the
relationship (s
added if multiplity is many). The generated one-to-many relationship
accessor names are all fine, as are all the other one-to-one
accessors I
have. Can you tell me why the s gets chopped and maybe give me a
hint to
work around this?
Thanks,
Bernie
---
Bernhard Meyer-Willner
Insurance - Financial Services
Logica GmbH
Alster City
Osterbekstrasse 90b
22083 Hamburg (Germany)
(+49) 40-27071-405
(+49) 177-425-9036
www.logica.de
This e-mail and any attachment is for authorised use by the
intended recipient(s) only. It may contain proprietary material,
confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any
other party. If you are not an intended recipient then please
promptly delete this e-mail and any attachment and all copies and
inform the sender. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not
be copied,
disclosed to, retained or used by, any other party. If you are
not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
This e-mail and any attachment is for authorised use by the
intended recipient(s) only. It may contain proprietary material,
confidential information and/or be subject to legal privilege. It
should not be copied, disclosed to, retained or used by, any other
party. If you are not an intended recipient then please promptly
delete this e-mail and any attachment and all copies and inform
the sender. Thank you.
Loading...