Am Mittwoch, 11. Juli 2012 14:33:10 UTC+2 schrieb Lukas Eder: Hello Aaron, > > > You added printFKSetter() to the default code but the feature is missing > in > > the interfaces and the pojos. > > The method signature wouldn't be compatible between records and pojos, > so putting any such method in the interfaces will be tricky as > generaetd interfaces are implemented by both records and pojos.
How about generating a getPK() method which always returns the (value of the) PK, no matter what the column is called? If you add that to the interface, you could use the interface type in the FK setters. I can see how it might make sense in pojos but then the pojos wouldn't > be pojos anymore. > What do you think? Would that really add value to pojos? > My main worry is that it breaks symmetry. Why can I do something with the record that I can't do with the POJO despite the fact that the POJO does have all the information necessary? > The same is true for the DAOs where it would be interesting to have > > getBy<ColumnName>( Long | Record ). > > Absolutely! Tracked as #1552: > https://sourceforge.net/apps/trac/jooq/ticket/1552 > > I guess it would be called findBy[...] to align method names with > existing ones. Spring Data uses "get". In Java, there is no real distinction between "return something that exists" and "search for something" -> both use "get" :-( > Or maybe fetchBy[...] to re-use the term "fetch"? [...]List<P> fetchByName(String...) > I like "fetch". Regards, A. Digulla
