I need to generate OM-Classes which i declare with torque, but
not the tables that go along with them. I am in need of the classes with
the declared attributes and getter/setter methods but don't need them
to be mapped to the db (cause those attributes are being stored somewhere else).
Now, i thought skipSql would do the trick, but ant stops in the middle of generating
the oms with a Exception from generator.parse (exactly on the OM-Class where i use
skipSql).
Well, anyway, does someone know if that's the right path? (i don't want to look
into the problem if skipSql isn't suited for this).
To clarify, here an excerpt of the project-schema.xml:
<!-- Subclasses of KnowledgeObject -->
<table name="Product" javaName="Product" skipSql="true"
baseClass="iknow.share.om.KnowledgeObject"
basePeer="iknow.share.om.KnowledgeObjectPeer">
<!-- Unique identifier -->
<column name="id" primaryKey="true" required="true" type="integer"/>
<!-- Fields for XML -->
<column name="lieferbedingungen" size="255" type="VARCHAR"/>
</table>
Now, Product is a subclass of KnowledgeObject and it is generated accordingly if i
take away
the "skipSql", only a table is generated which i don't want, also the Peer should not
have
methods to fill that table (cause i store the data elsewhere). Is skipSql here a
option and if
yes, anyone knows what could cause the troubles when generating the om-classes?
I also tried with this, but it seems that when i declare the table as an alias no
columns/attributes are being adopted:
<table name="Product" javaName="Product" alias="KnowledgeObject"
baseClass="iknow.share.om.KnowledgeObject"
basePeer="iknow.share.om.KnowledgeObjectPeer">
here is what the -debug option says when axecuting ant init with skipSql in the
project-schema:
BUILD FAILED
/usr/local/share/tdk/webapps/km01/WEB-INF/build/build.xml:178: Exception thrown by
'generator.parse'. For more information consult the velocity log.
at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:266)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.apache.tools.ant.Main.runBuild(Main.java:454)
at org.apache.tools.ant.Main.start(Main.java:153)
at org.apache.tools.ant.Main.main(Main.java:176)
--- Nested Exception ---
org.apache.velocity.exception.MethodInvocationException: Invocation of method
'getJavaNative' in class org.apache.turbine.torque.engine.database.model.Column threw
exception class java.lang.NullPointerException
at
org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java)
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
at org.apache.velocity.Template.merge(Template.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
at org.apache.velocity.Template.merge(Template.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:266)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.apache.tools.ant.Main.runBuild(Main.java:454)
at org.apache.tools.ant.Main.start(Main.java:153)
at org.apache.tools.ant.Main.main(Main.java:176)
tia, Christine
PS: it says to look into the velocity log, but there isn't written anything at all.