Generate DTO from JPA annotated class

View: New views
4 Messages — Rating Filter:   Alert me  

Generate DTO from JPA annotated class

by Shay Matasaro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I am looking for a utility that can take a JPA annotated
class(hibernate) and generate a DTO(Value object) class from it.

while doing my research i ran into the Value Object implementation of
XDoclet which looks great.

my question is, Is there an XDoclet implementation that can handle a JPA
class in a similar manner to the way that Value Object handles EJB classes?

Thanks,
Shay

------------------------------------------------------------------------------
_______________________________________________
xdoclet-user mailing list
xdoclet-user@...
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Parent Message unknown Re: Generate DTO from JPA annotated class

by Konstantin Priblouda :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


XDoclet s the right tool to do this, but it does not process
anotations,  but xdoclet ( kind-of javadoc ) tags instead.

To achieve your task you can start from existing hibernate plugin,
reuse its tag definitions and create your own velocity template.

regars,


----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/


--- On Thu, 7/2/09, Shay Matasaro <matasaro@...> wrote:

> From: Shay Matasaro <matasaro@...>
> Subject: [Xdoclet-user] Generate DTO from JPA annotated class
> To: xdoclet-user@...
> Date: Thursday, July 2, 2009, 3:21 PM
> Hi All,
>
> I am looking for a utility that can take a JPA annotated
> class(hibernate) and generate a DTO(Value object) class
> from it.
>
> while doing my research i ran into the Value Object
> implementation of
> XDoclet which looks great.
>
> my question is, Is there an XDoclet implementation that can
> handle a JPA
> class in a similar manner to the way that Value Object
> handles EJB classes?
>
> Thanks,
> Shay
>
> ------------------------------------------------------------------------------
> _______________________________________________
> xdoclet-user mailing list
> xdoclet-user@...
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>


     

------------------------------------------------------------------------------
_______________________________________________
xdoclet-user mailing list
xdoclet-user@...
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Re: Generate DTO from JPA annotated class

by Shay Matasaro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I think that i dont really need to process and hibernate specific tags,
just replicate the class , and have control over which fields and
methods get replicates , i would also like to generate a copy
constructor for both classes.


here is an example:


original class:

Package  sever;

@Entity
Class Customer
{
String name;


@do not replicate
String Password

getters and setters....

}


replicated class

Package  client;

Class Customer
{
String name;

Customer(server.customer from)
{
....
}

getters and setters....

}


Thanks,
Shay
Konstantin Priblouda wrote:

> XDoclet s the right tool to do this, but it does not process
> anotations,  but xdoclet ( kind-of javadoc ) tags instead.
>
> To achieve your task you can start from existing hibernate plugin,
> reuse its tag definitions and create your own velocity template.
>
> regars,
>
>
> ----[ Konstantin Pribluda http://www.pribluda.de ]----------------
> JTec quality components: http: fields //www.pribluda.de/projects/
>
>
> --- On Thu, 7/2/09, Shay Matasaro <matasaro@...> wrote:
>
>  
>> From: Shay Matasaro <matasaro@...>
>> Subject: [Xdoclet-user] Generate DTO from JPA annotated class
>> To: xdoclet-user@...
>> Date: Thursday, July 2, 2009, 3:21 PM
>> Hi All,
>>
>> I am looking for a utility that can take a JPA annotated
>> class(hibernate) and generate a DTO(Value object) class
>> from it.
>>
>> while doing my research i ran into the Value Object
>> implementation of
>> XDoclet which looks great.
>>
>> my question is, Is there an XDoclet implementation that can
>> handle a JPA
>> class in a similar manner to the way that Value Object
>> handles EJB classes?
>>
>> Thanks,
>> Shay
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> xdoclet-user mailing list
>> xdoclet-user@...
>> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>>
>>    
>
>
>      
>
> ------------------------------------------------------------------------------
> _______________________________________________
> xdoclet-user mailing list
> xdoclet-user@...
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>
>  


------------------------------------------------------------------------------
_______________________________________________
xdoclet-user mailing list
xdoclet-user@...
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Parent Message unknown Re: Generate DTO from JPA annotated class

by Konstantin Priblouda :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


In any case, you will need to know which fields are persistent -
and this information lives in hibernate tags.

regards,
----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/


--- On Fri, 7/3/09, Shay Matasaro <matasaro@...> wrote:

> From: Shay Matasaro <matasaro@...>
> Subject: Re: [Xdoclet-user] Generate DTO from JPA annotated class
> To: "End-user support for the XDoclet code generator" <xdoclet-user@...>
> Date: Friday, July 3, 2009, 3:00 PM
> Hi,
>
> I think that i dont really need to process and hibernate
> specific tags,
> just replicate the class , and have control over which
> fields and
> methods get replicates , i would also like to generate a
> copy
> constructor for both classes.
>
>
> here is an example:
>
>
> original class:
>
> Package  sever;
>
> @Entity
> Class Customer
> {
> String name;
>
>
> @do not replicate
> String Password
>
> getters and setters....
>
> }
>
>
> replicated class
>
> Package  client;
>
> Class Customer
> {
> String name;
>
> Customer(server.customer from)
> {
> ....
> }
>
> getters and setters....
>
> }
>
>
> Thanks,
> Shay
> Konstantin Priblouda wrote:
> > XDoclet s the right tool to do this, but it does not
> process
> > anotations,  but xdoclet ( kind-of javadoc ) tags
> instead.
> >
> > To achieve your task you can start from existing
> hibernate plugin,
> > reuse its tag definitions and create your own velocity
> template.
> >
> > regars,
> >
> >
> > ----[ Konstantin Pribluda http://www.pribluda.de ]----------------
> > JTec quality components: http: fields
> //www.pribluda.de/projects/
> >
> >
> > --- On Thu, 7/2/09, Shay Matasaro <matasaro@...>
> wrote:
> >
> >   
> >> From: Shay Matasaro <matasaro@...>
> >> Subject: [Xdoclet-user] Generate DTO from JPA
> annotated class
> >> To: xdoclet-user@...
> >> Date: Thursday, July 2, 2009, 3:21 PM
> >> Hi All,
> >>
> >> I am looking for a utility that can take a JPA
> annotated
> >> class(hibernate) and generate a DTO(Value object)
> class
> >> from it.
> >>
> >> while doing my research i ran into the Value
> Object
> >> implementation of
> >> XDoclet which looks great.
> >>
> >> my question is, Is there an XDoclet implementation
> that can
> >> handle a JPA
> >> class in a similar manner to the way that Value
> Object
> >> handles EJB classes?
> >>
> >> Thanks,
> >> Shay
> >>
> >>
> ------------------------------------------------------------------------------
> >> _______________________________________________
> >> xdoclet-user mailing list
> >> xdoclet-user@...
> >> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> >>
> >>     
> >
> >
> >       
> >
> >
> ------------------------------------------------------------------------------
> > _______________________________________________
> > xdoclet-user mailing list
> > xdoclet-user@...
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> >
> >   
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> xdoclet-user mailing list
> xdoclet-user@...
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>


     

------------------------------------------------------------------------------
_______________________________________________
xdoclet-user mailing list
xdoclet-user@...
https://lists.sourceforge.net/lists/listinfo/xdoclet-user