Quantcast

Torque Objects Implementing a Defined Interface

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Torque Objects Implementing a Defined Interface

Neil Sherman/Trapsoft Inc
Hi,

Is it possible to get generated Torque objects to implement a specific
interface ?

For example I have a Torque configuration that produces me a class called
TestOne that has a number of methods on it.

What I'd like to do is define an interface that only exposes one of those
methods.  That way I can pass this object around by interface, and only
expose a certain proportion of its capability.

So the generated class definition is something like:

public  class TestOne
    extends my.class.package.BaseTestOne
    implements Persistent

And I'd like it to become:

public  class TestOne
    extends my.class.package.BaseTestOne
    implements Persistent, MyDefinedInterface

I'm not expecting the generated class to implement any additional methods,
just group some of its existing methods into a define interface.

Thanks for your time

Neil
tv
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Torque Objects Implementing a Defined Interface

tv
On 04.07.11 13:01, Neil Sherman wrote:
> Hi,
>
> Is it possible to get generated Torque objects to implement a specific
> interface ?

See the documentation of the "interface" attribute to the "table"
element in the schema documentation
http://db.apache.org/torque/releases/torque-3.3/generator/schema-reference.html
This should do what you want.

Bye, Thomas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Torque Objects Implementing a Defined Interface

gm_kall
This post was updated on .
Hi,

is it also possible to have a generated interface not just in the Data objects but also in the generated Peer(Imp) classes in Torque 4 ?

I have read about integrating jaxb annotations, which would allow interface generation. Is this an alternative?

Best regards, Georg

Update: I solved this using Torque techniques, additionally I added it in Torque-JIRA: https://issues.apache.org/jira/browse/TORQUE-309.
Loading...