Singular vs. Plural names

566 views
Skip to first unread message

Christian Hammers

unread,
Aug 22, 2013, 1:36:21 PM8/22/13
to jooq...@googlegroups.com
Hello

My tables are usually called with plural names like "customers" as they contain
many rows. The generated ActiveRecord and POJO classes do thus also have this
name which looks ridiculous especially if I have lists of them:

Customers c = new Customers(); // a single one
List<Customers> customerss; // multiple

Is there any chance that JOOQ could be a little bit more clever about this?

The Propel ORM for example does a really good job using:
propel.builder.pluralizer.class = builder.util.StandardEnglishPluralizer
See http://propelorm.org/documentation/whats-new.html#better-pluralizer

Best Regards

-christian-

Lukas Eder

unread,
Aug 23, 2013, 5:52:40 AM8/23/13
to jooq...@googlegroups.com
Hello,

2013/8/22 Christian Hammers <c...@lathspell.de>

Hello

My tables are usually called with plural names like "customers" as they contain
many rows. The generated ActiveRecord and POJO classes do thus also have this
name which looks ridiculous especially if I have lists of them:

  Customers c = new Customers(); // a single one
  List<Customers> customerss;    // multiple

Is there any chance that JOOQ could be a little bit more clever about this?

jOOQ itself: Currently no. But you can:

By implementing a custom naming strategy, you can remove the trailing "s" from every table name.
 
The Propel ORM for example does a really good job using:
  propel.builder.pluralizer.class = builder.util.StandardEnglishPluralizer
See http://propelorm.org/documentation/whats-new.html#better-pluralizer

I'll have a look into that. Of course, a contribution would be very welcome as well ;-)

Cheers
Lukas

wua...@gmail.com

unread,
Apr 18, 2016, 4:33:45 AM4/18/16
to jOOQ User Group, c...@lathspell.de
Same problem here. Any solution?

Lukas Eder

unread,
Apr 18, 2016, 4:39:00 AM4/18/16
to jooq...@googlegroups.com
The solution remains the same as in my previous E-Mail:

At the time, I had decided not to look into this any further. It would be unwise to make any assumptions about user languages and usage of plural / singular names, while, at the same time it is very easy for you (having domain knowledge) to implement a solution using the existing means.

Here are updated manual links to help you get started:

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sigmund Lee

unread,
Apr 18, 2016, 10:38:54 AM4/18/16
to jooq...@googlegroups.com
Hi Lukas, thanks for prompt response.
About the solution you already mentioned before, I will try it out.

Best regards.

--
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/ln27b0vDUsA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.

Lukas Eder

unread,
Apr 18, 2016, 10:41:08 AM4/18/16
to jooq...@googlegroups.com
Excellent, thanks for the feedback, Sigmund.

Please, let us know if you encounter any issues / need more help.

Cheers,
Lukas
Reply all
Reply to author
Forward
0 new messages