Ok, it works now. When I run the ant script (task ibator.generate) I've got no warnings, but attributs and methods are overidden. So, i tried to use the eclipse plugin and started the 'Generate ibatis artifacts', and I had a popup explaining that the rootclass could not be found. So, I had the classpathentry tag... and .. magic, it works !
I think there's a confusion with the ant script classpath, and the classpath used by ibator... Thx very much for helping me. Jeremy Jeremy Jardin wrote: > > Well... I noticed something. > If I restart Eclipse and run the script, I've got the warning about the > rootClass not found. > But, when I run it again, it seems to work. > (it seem, because no warnings, but unfortunately, it doesn't work ;) > > So, I wonder if ibator really find the rootClass. I tried to add the > classpathEntry, but > where in the xml fie should I set it ? I saw that tag existed in abator, > but not in ibator ? am I wrong ? > > > Jeff Butler-2 wrote: >> >> It shouldn't make any difference - just using Java introspection to >> look for getter/setter methods. >> >> Jeff Butler >> >> >> On 4/8/10, Jeremy Jardin <jeremy.jar...@gmail.com> wrote: >>> >>> Ho, I thought about something.. is the order of the attributs in the >>> rootClass important ? >>> And what about comments ? >>> >>> >>> Jeff Butler-2 wrote: >>>> >>>> It is a mystery :). There are unit tests in the Ibator build that test >>>> this functionality and they are passing. If you're up for an >>>> experiment, try it with a build of Ibator from source - maybe >>>> something is wrong in the version you are using. >>>> >>>> Jeff Butler >>>> >>>> >>>> On 4/8/10, Jeremy Jardin <jeremy.jar...@gmail.com> wrote: >>>>> >>>>> So, I'll try to be more explicit :) >>>>> >>>>> The DecObject class is just a bean, with a lot of attributs. (more >>>>> than >>>>> 30..) >>>>> For instance, 3 of its : >>>>> private BigDecimal refCorinthe; >>>>> private String siren; >>>>> private String ndec >>>>> >>>>> public BigDecimal getRefCorinthe() { >>>>> return refCorinthe; >>>>> } >>>>> public void setRefCorinthe(BigDecimal refCorinthe) { >>>>> this.refCorinthe = refCorinthe; >>>>> } >>>>> public String getSiren() { >>>>> return siren; >>>>> } >>>>> public void setSiren(String siren) { >>>>> this.siren = siren == null ? null : siren.trim(); >>>>> } >>>>> public String getNdec() { >>>>> return ndec; >>>>> } >>>>> public void setNdec(String ndec) { >>>>> this.ndec = ndec == null ? null : ndec.trim(); >>>>> } >>>>> >>>>> >>>>> And, in the bean generated, I found that : (copy paste it, and removed >>>>> javadoc comments) >>>>> >>>>> /** >>>>> * This field was generated by Apache iBATIS ibator. This field >>>>> corresponds to the database column HISTORY_DEC.REF_CORINTHE >>>>> * @ibatorgenerated Thu Apr 08 14:29:48 CEST 2010 >>>>> */ >>>>> private BigDecimal refCorinthe; >>>>> /** >>>>> * This field was generated by Apache iBATIS ibator. This field >>>>> corresponds to the database column HISTORY_DEC.SIREN >>>>> * @ibatorgenerated Thu Apr 08 14:29:48 CEST 2010 >>>>> */ >>>>> private String siren; >>>>> >>>>> /** >>>>> * This field was generated by Apache iBATIS ibator. This field >>>>> corresponds to the database column HISTORY_DEC.NDEC >>>>> * @ibatorgenerated Thu Apr 08 14:29:48 CEST 2010 >>>>> */ >>>>> private String ndec; >>>>> >>>>> public String getNdec() { >>>>> return ndec; >>>>> } >>>>> public void setNdec(String ndec) { >>>>> this.ndec = ndec == null ? null : ndec.trim(); >>>>> } >>>>> public String getSiren() { >>>>> return siren; >>>>> } >>>>> public void setSiren(String siren) { >>>>> this.siren = siren == null ? null : siren.trim(); >>>>> } >>>>> public BigDecimal getRefCorinthe() { >>>>> return refCorinthe; >>>>> } >>>>> public void setRefCorinthe(BigDecimal refCorinthe) { >>>>> this.refCorinthe = refCorinthe; >>>>> } >>>>> >>>>> So, we can see that the attributs are matching.. >>>>> >>>>> >>>>> >>>>> >>>>> Jeff Butler-2 wrote: >>>>>> >>>>>> OK. Then I need to see some detail. What are the methods in the base >>>>>> class, and what is Ibator generating? >>>>>> >>>>>> Jeff Butler >>>>>> >>>>>> >>>>>> On Thu, Apr 8, 2010 at 9:20 AM, Jeremy Jardin >>>>>> <jeremy.jar...@gmail.com> >>>>>> wrote: >>>>>>> >>>>>>> Yes, I had that message the first time I ran the ant script. >>>>>>> >>>>>>> Then, I tried something with the classPathEntry tag, but it seems >>>>>>> to be working with Abator, and not with Ibator ? >>>>>>> >>>>>>> So, I had the jar containing the DecObject.class file in the >>>>>>> classpath of my ant script.. and no more warnings ! >>>>>>> But, Ibator still overrides attributs and methods.. >>>>>>> >>>>>>> >>>>>>> >>>>>>> Jeff Butler-2 wrote: >>>>>>>> >>>>>>>> Did you see a warning like this during your Ibator run: >>>>>>>> >>>>>>>> "Root class com.DecObject cannot be loaded, checking for member >>>>>>>> overrides is disabled for this class" >>>>>>>> >>>>>>>> If so, it means that DecObject is not in the class path and Ibator >>>>>>>> cannot check for overridden methods. Make sure that the compiled >>>>>>>> DecObject class is in Ibator's classpath, or add a <classPathEntry> >>>>>>>> configuration element specifying where the compiled class is. >>>>>>>> >>>>>>>> Jeff Butler >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Thu, Apr 8, 2010 at 7:21 AM, Jeremy Jardin >>>>>>>> <jeremy.jar...@gmail.com> >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I'd like Ibator to generate ibatis bean extending a specific >>>>>>>>> rootClass. >>>>>>>>> 3 of my tables are nearly the same. >>>>>>>>> So I did something like that in the ibator-conf.xml file : >>>>>>>>> >>>>>>>>> <ibatorContext> >>>>>>>>> <table tableName="HISTORY_DEC" >>>>>>>>> domainObjectName="HistoryDec"> >>>>>>>>> <property name="rootClass" value="com.DecObject" /> >>>>>>>>> </table> >>>>>>>>> </ibatorContext> >>>>>>>>> >>>>>>>>> The class DecObject is correctly found, and contains attributs >>>>>>>>> which >>>>>>>>> are >>>>>>>>> the >>>>>>>>> same >>>>>>>>> that in the generated HistoryDec class. >>>>>>>>> I checked that types and getter/setter were right, and it is. >>>>>>>>> >>>>>>>>> so, why ibator overrides attributs ? >>>>>>>>> >>>>>>>>> Thx, >>>>>>>>> >>>>>>>>> Jeremy >>>>>>>>> -- >>>>>>>>> View this message in context: >>>>>>>>> http://old.nabble.com/ibator-with-rootclass-overrides-getters-and-setters-tp28177744p28177744.html >>>>>>>>> Sent from the iBATIS - User - Java mailing list archive at >>>>>>>>> Nabble.com. >>>>>>>>> >>>>>>>>> >>>>>>>>> --------------------------------------------------------------------- >>>>>>>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>>>>>>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> --------------------------------------------------------------------- >>>>>>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>>>>>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> View this message in context: >>>>>>> http://old.nabble.com/ibator-with-rootclass-overrides-getters-and-setters-tp28177744p28179286.html >>>>>>> Sent from the iBATIS - User - Java mailing list archive at >>>>>>> Nabble.com. >>>>>>> >>>>>>> >>>>>>> --------------------------------------------------------------------- >>>>>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>>>>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>>>>>> >>>>>>> >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>>>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>>>>> >>>>>> >>>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://old.nabble.com/ibator-with-rootclass-overrides-getters-and-setters-tp28177744p28179656.html >>>>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com. >>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>>>> >>>>> >>>> >>>> -- >>>> Sent from my mobile device >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/ibator-with-rootclass-overrides-getters-and-setters-tp28177744p28182758.html >>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >>> For additional commands, e-mail: user-java-h...@ibatis.apache.org >>> >>> >> >> -- >> Sent from my mobile device >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >> For additional commands, e-mail: user-java-h...@ibatis.apache.org >> >> >> > > -- View this message in context: http://old.nabble.com/ibator-with-rootclass-overrides-getters-and-setters-tp28177744p28189585.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org