You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Neil Sherman <Ne...@trapezegroup.co.uk> on 2011/07/04 13:01:12 UTC

Torque Objects Implementing a Defined Interface

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

Re: Torque Objects Implementing a Defined Interface

Posted by gm_kall <ge...@fu-berlin.de>.
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



--
View this message in context: http://apache-database.10148.n7.nabble.com/Torque-Objects-Implementing-a-Defined-Interface-tp116609p137277.html
Sent from the Apache DB - Torque Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Torque Objects Implementing a Defined Interface

Posted by Thomas Vandahl <tv...@apache.org>.
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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org