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 Denis Vladimirov <de...@gmail.com> on 2005/12/12 01:42:20 UTC
Abator - Java Code Generator for iBATIS - Runtime Errors
Hi Jeff,
Here is what I have found in the log file:
!ENTRY org.apache.ibatis.abator.ui 4 4 2005-12-12 09:44:26.405
!MESSAGE Unexpected error while running Abator.
!STACK 0
java.lang.ArithmeticException: / by zero
at org.apache.ibatis.abator.ui.actions.RunAbatorThread.run(
RunAbatorThread.java:82)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java
:1719)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java
:1739)
at org.apache.ibatis.abator.ui.actions.RunAbatorAction$AbatorRunner.run(
RunAbatorAction.java:149)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(
ModalContext.java:113)
Is it possible to run this tool without Eclipse ?
Thanks,
Denis
Re: Abator - Java Code Generator for iBATIS - Runtime Errors
Posted by Jeff Butler <je...@gmail.com>.
Regarding dynamic SQL - I think the capability you need is already in
Abator. The XML configuration for the table element allows you to "turn
off" the generation of any (or all) statements for a table. A configuration
like this should do what you want:
<table schema="foo" tableName="bar" enableSelectByExample="false"
enableDeleteByExample="false" />
(Sorry this isn't better documented. It's all in the DTD, but that can be
kind of hard to read)
Jeff Butler
On 12/11/05, Denis Vladimirov <de...@gmail.com> wrote:
>
> Hi Jeff,
>
>
> > I'm not sure exactly what you mean by "turning off dynamic sql".
> >
>
> I meant turning off the generation of the dynamic sql methods/mappings in
> the DAOs and in the SQL map for some tables.
>
>
> I think the superclass is an interesting idea. It would be the
> > superclass of the primary key if the table had a primary key, or the
> > superclass of the "record" class otherwise. Is that what you're thinking?
> >
> >
> That would be a superclass of the "record" class. All our model classes
> extend the same AbstractModelClass which has some common functionality for
> the all Models
>
> Regards,
> Denis
>
Re: Abator - Java Code Generator for iBATIS - Runtime Errors
Posted by Denis Vladimirov <de...@gmail.com>.
Hi Jeff,
> I'm not sure exactly what you mean by "turning off dynamic sql".
>
I meant turning off the generation of the dynamic sql methods/mappings in
the DAOs and in the SQL map for some tables.
I think the superclass is an interesting idea. It would be the superclass
> of the primary key if the table had a primary key, or the superclass of the
> "record" class otherwise. Is that what you're thinking?
>
>
That would be a superclass of the "record" class. All our model classes
extend the same AbstractModelClass which has some common functionality for
the all Models
Regards,
Denis
Re: Abator - Java Code Generator for iBATIS - Runtime Errors
Posted by Jeff Butler <je...@gmail.com>.
Hi Denis,
I'm not sure exactly what you mean by "turning off dynamic sql". There are
several attributes on the <table> element that will turn off certain
statements (enableSelectByExample="false", enableDeleteByExample="false",
etc.) Does that meet your need? (If the "*byExample" statements are
disabled, there won't be any dynamic SQL in the map)
I think the superclass is an interesting idea. It would be the superclass
of the primary key if the table had a primary key, or the superclass of the
"record" class otherwise. Is that what you're thinking?
Jeff Butler
On 12/11/05, Denis Vladimirov <de...@gmail.com> wrote:
>
> Hi Jeff,
> I found the problem. That table was a synonim, so I have just changed
> schema name to the schema name that owns that table and it works.
> Would be nice to have an option where you specify a super class for the
> Model you are going to generate like this :
>
> <javaModelGenerator targetPackage="test.model" targetProject="vlad">
> <property name="enableSubPackages" value="true" />
> <property name="trimStrings" value="true" />
> <property name="superClass" value="AbstractModel" />
> </javaModelGenerator>
>
> also would be nice to have an option of turning On and Off dyanmicSQL for
> some tables, like this:
>
> <table schema="COMMON" tableName="PARAMETERS" domainObjectName="Parameter"
> >
> <property name="useActualColumnNames" value="true"/>
> <property name="createDynamicSQL" value="true"/> <!-- default is
> false -->
> </table>
>
> Otherwise its exellent tool
>
> Regards,
> Denis
>
Re: Abator - Java Code Generator for iBATIS - Runtime Errors
Posted by Denis Vladimirov <de...@gmail.com>.
Hi Jeff,
I found the problem. That table was a synonim, so I have just changed schema
name to the schema name that owns that table and it works.
Would be nice to have an option where you specify a super class for the
Model you are going to generate like this :
<javaModelGenerator targetPackage="test.model" targetProject="vlad">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
<property name="superClass" value="AbstractModel" />
</javaModelGenerator>
also would be nice to have an option of turning On and Off dyanmicSQL for
some tables, like this:
<table schema="COMMON" tableName="PARAMETERS" domainObjectName="Parameter" >
<property name="useActualColumnNames" value="true"/>
<property name="createDynamicSQL" value="true"/> <!-- default is false
-->
</table>
Otherwise its exellent tool
Regards,
Denis
Re: Abator - Java Code Generator for iBATIS - Runtime Errors
Posted by Jeff Butler <je...@gmail.com>.
I see the problem. I'll have to make a change so that such an error isn't
thrown.
The underlying problem is that Abator is not seeing any valid table from
your configuration. From your prior note, I see that you specified this:
schema="denis" tableName="PARAMETERS
The schma and tableName are probably case sensitive in Oracle - try both as
upper case.
Abator does have a base functionality that is available outside Eclipse, but
it would take some work. I'm getting a lot of questions about that, so I'll
try to post a more complete explanation about it tomorrow.
Jeff Butler
On 12/11/05, Denis Vladimirov <de...@gmail.com> wrote:
>
> Hi Jeff,
>
> Here is what I have found in the log file:
>
> !ENTRY org.apache.ibatis.abator.ui 4 4 2005-12-12 09:44: 26.405
> !MESSAGE Unexpected error while running Abator.
> !STACK 0
> java.lang.ArithmeticException : / by zero
> at org.apache.ibatis.abator.ui.actions.RunAbatorThread.run(
> RunAbatorThread.java:82)
> at org.eclipse.core.internal.resources.Workspace.run (Workspace.java
> :1719)
> at org.eclipse.core.internal.resources.Workspace.run (Workspace.java
> :1739)
> at
> org.apache.ibatis.abator.ui.actions.RunAbatorAction$AbatorRunner.run(
> RunAbatorAction.java:149)
> at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (
> ModalContext.java:113)
>
>
> Is it possible to run this tool without Eclipse ?
>
> Thanks,
> Denis
>
>