Discussion:
[Middlegen-user] Final S gets chopped in CMR methods
Meyer-Willner, Bernhard
2002-08-08 11:31:06 UTC
Permalink
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
mailto:Meyer-***@logica.com
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.
Aslak Hellesøy
2002-08-08 15:17:06 UTC
Permalink
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
Loading...