[JBoss-dev] Custom / Generated Finders non-spec compliant
Hi, combing through the JBoss SF Bug database I found the following in the patches section: http://sourceforge.net/tracker/index.php?func=detailaid=437043group_id=22866atid=376687 Whoever submitted this is actually correct; the EJB Spec (1.1 and 2.0) state that Finder methods should be prefixed by find (i.e. findMETHOD). The spec doesn't require findBy except for the findByPrimaryKey method of course. The suggested patch would fix the problem but this is only half of the story (it will only deal with custom finders declared in the home interface): all of JBoss's auto-generated finder methods for CMP EB's are also prefixed by findBy which doesn't seem valid according to the specs; i.e. if you have a CMP field String name; the generated finder method should read Collection findName(String parameter); but JBoss generates Collection findByName(String parameter); I haven't seen anybody complaining about this (the findBy prefix is more intuitive anyways IMO) but this should be fixed. The fix seems easy enough and I would be willing to take it but this could break a lot of apps out there that rely on the method being prefixed with findBy ... Any opinions on this? We could just generate the spec-compliant methods AND the findBy stuff but this seems a bit awkward ... Best regards, Christian ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] Custom / Generated Finders non-spec compliant
I am VERY new to the JBoss-dev list but... I haven't seen anybody complaining about this (the findBy prefix is more intuitive anyways IMO) but this should be fixed. The fix seems easy enough and I would be willing to take it but this could break a lot of apps out there that rely on the method being prefixed with findBy ... Any opinions on this? We could just generate the spec-compliant methods AND the findBy stuff but this seems a bit awkward ... why don't you just generate the method as findmethod but generate a findBymethod also which calls the findmethod? al ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Custom / Generated Finders non-spec compliant
JBoss auto generated queries are outside of the spec. JBoss uses the findBy start to signal the system that it should attempt to auto generate a simple single field finder. I think that BMP custom finders in CMP is also non-spec, but jaws should support findX named queries. JBossCMP already supports custom finders starting with just find. -dain Christian Riege wrote: Hi, combing through the JBoss SF Bug database I found the following in the patches section: http://sourceforge.net/tracker/index.php?func=detailaid=437043group_id=22866atid=376687 Whoever submitted this is actually correct; the EJB Spec (1.1 and 2.0) state that Finder methods should be prefixed by find (i.e. findMETHOD). The spec doesn't require findBy except for the findByPrimaryKey method of course. The suggested patch would fix the problem but this is only half of the story (it will only deal with custom finders declared in the home interface): all of JBoss's auto-generated finder methods for CMP EB's are also prefixed by findBy which doesn't seem valid according to the specs; i.e. if you have a CMP field String name; the generated finder method should read Collection findName(String parameter); but JBoss generates Collection findByName(String parameter); I haven't seen anybody complaining about this (the findBy prefix is more intuitive anyways IMO) but this should be fixed. The fix seems easy enough and I would be willing to take it but this could break a lot of apps out there that rely on the method being prefixed with findBy ... Any opinions on this? We could just generate the spec-compliant methods AND the findBy stuff but this seems a bit awkward ... Best regards, Christian ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development