You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by NathanM <na...@infdig.com> on 2009/05/23 01:53:26 UTC

Ibtor not preserving custom methods

The ibator documentation states this:
"Every field and method generated by Ibator includes the non-standard
JavaDoc tag @ibatorgenerated. On subsequent runs of Ibator, every field and
method that includes this JavaDoc tag will be deleted and replaced. Any
other field or method in the class will be untouched by Ibator. With this in
mind, you can add other fields and methods to the classes without fear of
losing them in subsequent runs of Ibator - simply DO NOT include the
@ibatorgenerated JavaDoc tag on anything that you add to the class."

However, that is not the behavior I see. What I see is:
If the overwrite flag is true, the file is completely overwritten. Custom
methods, that did not contain the @ibatorgenerated flag are nowhere to be
found. 
If the overwrite flag is false, it creates a java.1 file and does not touch
the existing file. 

What's happening? 

Nathan 

-- 
View this message in context: http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23679529.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Ibtor not preserving custom methods

Posted by Jeff Butler <je...@gmail.com>.
Sorry - make that two *ant* tasks - not two eclipse tasks.

Jeff Butler

On Mon, May 25, 2009 at 2:19 PM, Jeff Butler <je...@gmail.com> wrote:

> There are two eclipse tasks - one in the base ibator.jar, another in the
> eclipse plugin.  You need to use the one in the eclipse plugin.  You are not
> using the Ant task in eclipse.
>
> Look in the ecflipse help for Ibator - there is a page on running Ant in
> eclipse.  Here's the SVN link too:
>
>
> http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html
>
> Jeff Butler
>
>
>
>
>
> On Mon, May 25, 2009 at 2:10 PM, NathanM <na...@infdig.com> wrote:
>
>>
>>
>>
>> Jeff Butler-2 wrote:
>> >
>> > If you use the eclipse integrated ant task in eclipse you can solve both
>> > problems - you can control the classpath through the Ant launch
>> > configuration, anf the integrated ant task supports Java merging.
>> >
>> > Jeff Butler
>> >
>> >
>> >
>>
>> I thought I *was* using the integrated ant task and it is overwriting
>> everything. Do you see anything wrong with my ant target snippet below?
>>
>> It works but it does not automerge the java files.
>>
>> Nathan
>>
>>
>>    <target name="genfiles" description="Generate the files">
>>      <taskdef name="ibator"
>>               classname="org.apache.ibatis.ibator.ant.IbatorAntTask"
>>               classpath="lib\ibator.jar;bin" />
>>      <ibator overwrite="false" configfile="ibatorConfig.xml"
>> verbose="false" >
>>        <propertyset>
>>          <propertyref name="generated.source.dir"/>
>>        </propertyset>
>>      </ibator>
>>    </target>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23710953.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>

Re: Ibtor not preserving custom methods

Posted by Jeff Butler <je...@gmail.com>.
There are two eclipse tasks - one in the base ibator.jar, another in the
eclipse plugin.  You need to use the one in the eclipse plugin.  You are not
using the Ant task in eclipse.

Look in the ecflipse help for Ibator - there is a page on running Ant in
eclipse.  Here's the SVN link too:

http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html

Jeff Butler




On Mon, May 25, 2009 at 2:10 PM, NathanM <na...@infdig.com> wrote:

>
>
>
> Jeff Butler-2 wrote:
> >
> > If you use the eclipse integrated ant task in eclipse you can solve both
> > problems - you can control the classpath through the Ant launch
> > configuration, anf the integrated ant task supports Java merging.
> >
> > Jeff Butler
> >
> >
> >
>
> I thought I *was* using the integrated ant task and it is overwriting
> everything. Do you see anything wrong with my ant target snippet below?
>
> It works but it does not automerge the java files.
>
> Nathan
>
>
>    <target name="genfiles" description="Generate the files">
>      <taskdef name="ibator"
>               classname="org.apache.ibatis.ibator.ant.IbatorAntTask"
>               classpath="lib\ibator.jar;bin" />
>      <ibator overwrite="false" configfile="ibatorConfig.xml"
> verbose="false" >
>        <propertyset>
>          <propertyref name="generated.source.dir"/>
>        </propertyset>
>      </ibator>
>    </target>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23710953.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: Ibtor not preserving custom methods

Posted by NathanM <na...@infdig.com>.


Jeff Butler-2 wrote:
> 
> If you use the eclipse integrated ant task in eclipse you can solve both
> problems - you can control the classpath through the Ant launch
> configuration, anf the integrated ant task supports Java merging.
> 
> Jeff Butler
> 
> 
> 

I thought I *was* using the integrated ant task and it is overwriting
everything. Do you see anything wrong with my ant target snippet below? 

It works but it does not automerge the java files. 

Nathan


    <target name="genfiles" description="Generate the files">
      <taskdef name="ibator"
               classname="org.apache.ibatis.ibator.ant.IbatorAntTask"
               classpath="lib\ibator.jar;bin" />
      <ibator overwrite="false" configfile="ibatorConfig.xml"
verbose="false" >
        <propertyset>
          <propertyref name="generated.source.dir"/>
        </propertyset>
      </ibator>
    </target>




-- 
View this message in context: http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23710953.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Ibtor not preserving custom methods

Posted by Jeff Butler <je...@gmail.com>.
If you use the eclipse integrated ant task in eclipse you can solve both
problems - you can control the classpath through the Ant launch
configuration, anf the integrated ant task supports Java merging.

Jeff Butler


On Mon, May 25, 2009 at 1:42 PM, NathanM <na...@infdig.com> wrote:

>
> I believe you're right. But that puts me in a bit of a bind. I had to put
> in
> a custom JavaTypeResolver, which wouldn't work with the Eclipse plugin
> because I couldn't add it to the classpath. I've done it from the command
> line and now the ant build task, but i run into the problem mentioned here.
>
> I'll probably try and merge my custom type resolver into the ibator jar so
> at least the plugin will work.
>
> Nathan
>
>
> Dan Turkenkopf wrote:
> >
> > As far as I know, that's only true from the Eclipse plugin.
> >
> > This is the excerpt from the documentation on the Web site:
> >
> > "Every field and method generated by Ibator includes the non-standard
> > JavaDoc tag @ibatorgenerated. When run from the Eclipse plugin, on
> > subsequent runs of Ibator every Java element that includes this JavaDoc
> > tag
> > will be deleted and replaced. Any other Java element in the class will be
> > untouched by Ibator. With this in mind, you can add other fields and
> > methods
> > to the classes without fear of losing them in subsequent runs of Ibator -
> > simply DO NOT include the @ibatorgenerated JavaDoc tag on anything that
> > you
> > add to the class.
> >
> > Outside of the Eclipse plugin, Java files need to be merged by hand, but
> > you
> > can use the @ibatorgenerated JavaDoc tag to know what is safe to delete
> > from
> > a prior version of a file."
> >
> > The plugin uses the merging capabilities that are part of the Eclipse
> > platform.  There's no easy way to accomplish the same task running
> outside
> > Eclipse.  I know Jeff has talked about implementing it in the past, but
> > it's
> > a whole lot of work to do right.
> >
> > Hope this helps,
> >
> > Dan Turkenkopf
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23710609.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: Ibtor not preserving custom methods

Posted by NathanM <na...@infdig.com>.
I believe you're right. But that puts me in a bit of a bind. I had to put in
a custom JavaTypeResolver, which wouldn't work with the Eclipse plugin
because I couldn't add it to the classpath. I've done it from the command
line and now the ant build task, but i run into the problem mentioned here. 

I'll probably try and merge my custom type resolver into the ibator jar so
at least the plugin will work.   

Nathan


Dan Turkenkopf wrote:
> 
> As far as I know, that's only true from the Eclipse plugin.
> 
> This is the excerpt from the documentation on the Web site:
> 
> "Every field and method generated by Ibator includes the non-standard
> JavaDoc tag @ibatorgenerated. When run from the Eclipse plugin, on
> subsequent runs of Ibator every Java element that includes this JavaDoc
> tag
> will be deleted and replaced. Any other Java element in the class will be
> untouched by Ibator. With this in mind, you can add other fields and
> methods
> to the classes without fear of losing them in subsequent runs of Ibator -
> simply DO NOT include the @ibatorgenerated JavaDoc tag on anything that
> you
> add to the class.
> 
> Outside of the Eclipse plugin, Java files need to be merged by hand, but
> you
> can use the @ibatorgenerated JavaDoc tag to know what is safe to delete
> from
> a prior version of a file."
> 
> The plugin uses the merging capabilities that are part of the Eclipse
> platform.  There's no easy way to accomplish the same task running outside
> Eclipse.  I know Jeff has talked about implementing it in the past, but
> it's
> a whole lot of work to do right.
> 
> Hope this helps,
> 
> Dan Turkenkopf
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23710609.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Ibtor not preserving custom methods

Posted by Dan Turkenkopf <dt...@gmail.com>.
As far as I know, that's only true from the Eclipse plugin.

This is the excerpt from the documentation on the Web site:

"Every field and method generated by Ibator includes the non-standard
JavaDoc tag @ibatorgenerated. When run from the Eclipse plugin, on
subsequent runs of Ibator every Java element that includes this JavaDoc tag
will be deleted and replaced. Any other Java element in the class will be
untouched by Ibator. With this in mind, you can add other fields and methods
to the classes without fear of losing them in subsequent runs of Ibator -
simply DO NOT include the @ibatorgenerated JavaDoc tag on anything that you
add to the class.

Outside of the Eclipse plugin, Java files need to be merged by hand, but you
can use the @ibatorgenerated JavaDoc tag to know what is safe to delete from
a prior version of a file."

The plugin uses the merging capabilities that are part of the Eclipse
platform.  There's no easy way to accomplish the same task running outside
Eclipse.  I know Jeff has talked about implementing it in the past, but it's
a whole lot of work to do right.

Hope this helps,

Dan Turkenkopf

On Fri, May 22, 2009 at 7:53 PM, NathanM <na...@infdig.com> wrote:

>
> The ibator documentation states this:
> "Every field and method generated by Ibator includes the non-standard
> JavaDoc tag @ibatorgenerated. On subsequent runs of Ibator, every field and
> method that includes this JavaDoc tag will be deleted and replaced. Any
> other field or method in the class will be untouched by Ibator. With this
> in
> mind, you can add other fields and methods to the classes without fear of
> losing them in subsequent runs of Ibator - simply DO NOT include the
> @ibatorgenerated JavaDoc tag on anything that you add to the class."
>
> However, that is not the behavior I see. What I see is:
> If the overwrite flag is true, the file is completely overwritten. Custom
> methods, that did not contain the @ibatorgenerated flag are nowhere to be
> found.
> If the overwrite flag is false, it creates a java.1 file and does not touch
> the existing file.
>
> What's happening?
>
> Nathan
>
> --
> View this message in context:
> http://www.nabble.com/Ibtor-not-preserving-custom-methods-tp23679529p23679529.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>