You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by linda rae <lr...@dragon-research.com> on 2007/05/16 14:58:07 UTC
Will reversemappingTask() generate EJB3 annotations?
I apologize if this question has been previously asked and answered. I have googled for an answer with no luck.
I have been requested to use OpenJPA on a project. The tool appears straight forward and works well, I have ran the reverse engineering example on my own DB - it works great. However... no EJB3 annotations were generated (@Entity, etc).
What configuration option must I define to have the reversemapping tool generate an EJB3 EntityEJB?
A short response would be great - any response would would really help (am I asking for something that does not exist?)
Thank-you,
Linda Rae
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by pl...@gmail.com.
Re generics: that's a missing feature. The code generator predates
Java 5. Probablyyou can use the JavaVersions class to decide whether
to do generics or not.
Re interface changes: enhance away!
-Patrick
On 5/23/07, Gokhan Ergul <go...@telenity.com> wrote:
> Patrick Linskey wrote:
> >> Would you guys be interested in getting donations in that area?
> >
> > Certainly!
> >
> >> We do have our homegrown solution that does that (along with some other
> >> goodies as well). It's currently based on our metadata representation
> >> reverse-engineered from the database schema, it'd be nice (read: more
> >> flexible and maintainable) to have it based on openjpa metadata and
> >> integrated in openjpa itself for the community to use.
> >
> > The basics could be implemented as a new subtype of
> > ReverseMappingTool.ReverseCodeGenerator that did more intelligent
> > things in the various field / method generators; ideally, we'd want to
> > provide options for things like leaving ORM metadata in XML but
> > putting @Entity and @Id etc. in classes, and obviously the ability to
> > not write any XML at all and put everything in annotations instead.
>
> Finally had some time to look into this. Quick question: it seems we
> don't support generic collections for "to-many" relations while
> generating code --is that deliberate or just a missing feature I could add?
>
> About subtyping ReverseMappingTool.ReverseCodeGenerator: it goes a bit
> beyond that. To generate class annotations, I'll need to mess around
> with openjpa-kernel/.../enhance/CodeGenerator, at the least promote
> getClassCode(String packageDec, String imports, ...) method from private
> to protected --least impact, but hardly an elegant solution. Is it ok if
> I make a few enhancements there (obviously preserving existing behaviour)?
>
> Gokhan.
>
--
Patrick Linskey
202 669 5907
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Gokhan Ergul <go...@telenity.com>.
Patrick Linskey wrote:
>> Would you guys be interested in getting donations in that area?
>
> Certainly!
>
>> We do have our homegrown solution that does that (along with some other
>> goodies as well). It's currently based on our metadata representation
>> reverse-engineered from the database schema, it'd be nice (read: more
>> flexible and maintainable) to have it based on openjpa metadata and
>> integrated in openjpa itself for the community to use.
>
> The basics could be implemented as a new subtype of
> ReverseMappingTool.ReverseCodeGenerator that did more intelligent
> things in the various field / method generators; ideally, we'd want to
> provide options for things like leaving ORM metadata in XML but
> putting @Entity and @Id etc. in classes, and obviously the ability to
> not write any XML at all and put everything in annotations instead.
Finally had some time to look into this. Quick question: it seems we
don't support generic collections for "to-many" relations while
generating code --is that deliberate or just a missing feature I could add?
About subtyping ReverseMappingTool.ReverseCodeGenerator: it goes a bit
beyond that. To generate class annotations, I'll need to mess around
with openjpa-kernel/.../enhance/CodeGenerator, at the least promote
getClassCode(String packageDec, String imports, ...) method from private
to protected --least impact, but hardly an elegant solution. Is it ok if
I make a few enhancements there (obviously preserving existing behaviour)?
Gokhan.
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Marc Prud'hommeaux <mp...@apache.org>.
IMO, mailing list is probably good for discussing strategies and
techniques. JIRA reports are good for providing implementation
summaries and proposed patches.
On May 16, 2007, at 4:58 PM, Gokhan Ergul wrote:
> Marc, Patrick,
>
> What would be the correct medium to discuss various design/
> implementation details? This mailing list / jira or somewhere else?
>
> Gokhan.
>
> Marc Prud'hommeaux wrote:
>>
>> I've gone ahead and created https://issues.apache.org/jira/browse/
>> OPENJPA-239 in order to track comments and patches for this issue.
>>
>>
>>
>> On May 16, 2007, at 12:56 PM, Patrick Linskey wrote:
>>
>>>> Would you guys be interested in getting donations in that area?
>>>
>>> Certainly!
>>>
>>>> We do have our homegrown solution that does that (along with
>>>> some other
>>>> goodies as well). It's currently based on our metadata
>>>> representation
>>>> reverse-engineered from the database schema, it'd be nice (read:
>>>> more
>>>> flexible and maintainable) to have it based on openjpa metadata and
>>>> integrated in openjpa itself for the community to use.
>>>
>>> The basics could be implemented as a new subtype of
>>> ReverseMappingTool.ReverseCodeGenerator that did more intelligent
>>> things in the various field / method generators; ideally, we'd
>>> want to
>>> provide options for things like leaving ORM metadata in XML but
>>> putting @Entity and @Id etc. in classes, and obviously the
>>> ability to
>>> not write any XML at all and put everything in annotations instead.
>>>
>>> -Patrick
>>>
>
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Gokhan Ergul <go...@telenity.com>.
Marc, Patrick,
What would be the correct medium to discuss various
design/implementation details? This mailing list / jira or somewhere else?
Gokhan.
Marc Prud'hommeaux wrote:
>
> I've gone ahead and created
> https://issues.apache.org/jira/browse/OPENJPA-239 in order to track
> comments and patches for this issue.
>
>
>
> On May 16, 2007, at 12:56 PM, Patrick Linskey wrote:
>
>>> Would you guys be interested in getting donations in that area?
>>
>> Certainly!
>>
>>> We do have our homegrown solution that does that (along with some other
>>> goodies as well). It's currently based on our metadata representation
>>> reverse-engineered from the database schema, it'd be nice (read: more
>>> flexible and maintainable) to have it based on openjpa metadata and
>>> integrated in openjpa itself for the community to use.
>>
>> The basics could be implemented as a new subtype of
>> ReverseMappingTool.ReverseCodeGenerator that did more intelligent
>> things in the various field / method generators; ideally, we'd want to
>> provide options for things like leaving ORM metadata in XML but
>> putting @Entity and @Id etc. in classes, and obviously the ability to
>> not write any XML at all and put everything in annotations instead.
>>
>> -Patrick
>>
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Marc Prud'hommeaux <mp...@apache.org>.
I've gone ahead and created https://issues.apache.org/jira/browse/
OPENJPA-239 in order to track comments and patches for this issue.
On May 16, 2007, at 12:56 PM, Patrick Linskey wrote:
>> Would you guys be interested in getting donations in that area?
>
> Certainly!
>
>> We do have our homegrown solution that does that (along with some
>> other
>> goodies as well). It's currently based on our metadata representation
>> reverse-engineered from the database schema, it'd be nice (read: more
>> flexible and maintainable) to have it based on openjpa metadata and
>> integrated in openjpa itself for the community to use.
>
> The basics could be implemented as a new subtype of
> ReverseMappingTool.ReverseCodeGenerator that did more intelligent
> things in the various field / method generators; ideally, we'd want to
> provide options for things like leaving ORM metadata in XML but
> putting @Entity and @Id etc. in classes, and obviously the ability to
> not write any XML at all and put everything in annotations instead.
>
> -Patrick
>
> On 5/16/07, Gokhan Ergul <go...@telenity.com> wrote:
>> Marc Prud'hommeaux wrote:
>> >
>> > That is correct: the reversemappingtool only currently supports
>> > generating an orm.xml file. We would like to add support for
>> > generating annotations someday, but it is not there yet.
>> >
>>
>> Would you guys be interested in getting donations in that area? We do
>> have our homegrown solution that does that (along with some other
>> goodies as well). It's currently based on our metadata representation
>> reverse-engineered from the database schema, it'd be nice (read: more
>> flexible and maintainable) to have it based on openjpa metadata and
>> integrated in openjpa itself for the community to use.
>>
>> Gokhan.
>>
>>
>>
>>
>>
>
>
> --
> Patrick Linskey
> 202 669 5907
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Patrick Linskey <pl...@gmail.com>.
> Would you guys be interested in getting donations in that area?
Certainly!
> We do have our homegrown solution that does that (along with some other
> goodies as well). It's currently based on our metadata representation
> reverse-engineered from the database schema, it'd be nice (read: more
> flexible and maintainable) to have it based on openjpa metadata and
> integrated in openjpa itself for the community to use.
The basics could be implemented as a new subtype of
ReverseMappingTool.ReverseCodeGenerator that did more intelligent
things in the various field / method generators; ideally, we'd want to
provide options for things like leaving ORM metadata in XML but
putting @Entity and @Id etc. in classes, and obviously the ability to
not write any XML at all and put everything in annotations instead.
-Patrick
On 5/16/07, Gokhan Ergul <go...@telenity.com> wrote:
> Marc Prud'hommeaux wrote:
> >
> > That is correct: the reversemappingtool only currently supports
> > generating an orm.xml file. We would like to add support for
> > generating annotations someday, but it is not there yet.
> >
>
> Would you guys be interested in getting donations in that area? We do
> have our homegrown solution that does that (along with some other
> goodies as well). It's currently based on our metadata representation
> reverse-engineered from the database schema, it'd be nice (read: more
> flexible and maintainable) to have it based on openjpa metadata and
> integrated in openjpa itself for the community to use.
>
> Gokhan.
>
>
>
>
>
--
Patrick Linskey
202 669 5907
RE: Will reversemappingTask() generate EJB3 annotations?
Posted by Phill Moran <pj...@rogers.com>.
I would say so
-----Original Message-----
From: Gokhan Ergul [mailto:gokhan.ergul@telenity.com]
Sent: May 16, 2007 3:17 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: Will reversemappingTask() generate EJB3 annotations?
Marc Prud'hommeaux wrote:
>
> That is correct: the reversemappingtool only currently supports
> generating an orm.xml file. We would like to add support for
> generating annotations someday, but it is not there yet.
>
Would you guys be interested in getting donations in that area? We do have our
homegrown solution that does that (along with some other goodies as well). It's
currently based on our metadata representation reverse-engineered from the
database schema, it'd be nice (read: more flexible and maintainable) to have it
based on openjpa metadata and integrated in openjpa itself for the community to
use.
Gokhan.
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Gokhan Ergul <go...@telenity.com>.
Marc Prud'hommeaux wrote:
>
> That is correct: the reversemappingtool only currently supports
> generating an orm.xml file. We would like to add support for
> generating annotations someday, but it is not there yet.
>
Would you guys be interested in getting donations in that area? We do
have our homegrown solution that does that (along with some other
goodies as well). It's currently based on our metadata representation
reverse-engineered from the database schema, it'd be nice (read: more
flexible and maintainable) to have it based on openjpa metadata and
integrated in openjpa itself for the community to use.
Gokhan.
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Patrick Linskey <pl...@gmail.com>.
Also, FWIW, the BEA Workshop tool (eclipse-based) will
reverse-generate classes from a database as well, and supports putting
the metadata into annotations.
-Patrick
On 5/16/07, Marc Prud'hommeaux <mp...@apache.org> wrote:
>
> That is correct: the reversemappingtool only currently supports
> generating an orm.xml file. We would like to add support for
> generating annotations someday, but it is not there yet.
>
> Take a look at the "reversemapping" example in a recent openjpa
> snapshot for an example of running the reversemappingtool from a
> build.xml file.
>
>
>
> On May 16, 2007, at 10:26 AM, Michael Dick wrote:
>
> > That's what I've found too. The reversemapping tool will create new
> > java
> > files based on the database tables, and provide an orm.xml file. No
> > annotations though.
> >
> > You can always add them based on the generated orm.xml file
> > although that
> > might be easier said than done if you have a lot of entities.
> >
> > -mike
> >
> > On 5/16/07, Phill Moran <pj...@rogers.com> wrote:
> >>
> >> I am not sure that it will annotate your exiting code but (I
> >> think) it
> >> will make
> >> an external mapping file for you or generate the annotated classes
> >> from
> >> the
> >> ground up. Check out the MappingTool class/docs
> >>
> >> -----Original Message-----
> >> From: linda rae [mailto:lrae@dragon-research.com]
> >> Sent: May 16, 2007 8:58 AM
> >> To: open-jpa-dev@incubator.apache.org; open-jpa-
> >> dev@incubator.apache.org
> >> Subject: Will reversemappingTask() generate EJB3 annotations?
> >>
> >> I apologize if this question has been previously asked and
> >> answered. I
> >> have
> >> googled for an answer with no luck.
> >>
> >> I have been requested to use OpenJPA on a project. The tool appears
> >> straight
> >> forward and works well, I have ran the reverse engineering example
> >> on my
> >> own DB
> >> - it works great. However... no EJB3 annotations were generated
> >> (@Entity,
> >> etc).
> >>
> >>
> >> What configuration option must I define to have the reversemapping
> >> tool
> >> generate
> >> an EJB3 EntityEJB?
> >>
> >> A short response would be great - any response would would really
> >> help (am
> >> I
> >> asking for something that does not exist?)
> >>
> >> Thank-you,
> >>
> >> Linda Rae
> >>
> >>
> >>
>
>
--
Patrick Linskey
202 669 5907
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Marc Prud'hommeaux <mp...@apache.org>.
That is correct: the reversemappingtool only currently supports
generating an orm.xml file. We would like to add support for
generating annotations someday, but it is not there yet.
Take a look at the "reversemapping" example in a recent openjpa
snapshot for an example of running the reversemappingtool from a
build.xml file.
On May 16, 2007, at 10:26 AM, Michael Dick wrote:
> That's what I've found too. The reversemapping tool will create new
> java
> files based on the database tables, and provide an orm.xml file. No
> annotations though.
>
> You can always add them based on the generated orm.xml file
> although that
> might be easier said than done if you have a lot of entities.
>
> -mike
>
> On 5/16/07, Phill Moran <pj...@rogers.com> wrote:
>>
>> I am not sure that it will annotate your exiting code but (I
>> think) it
>> will make
>> an external mapping file for you or generate the annotated classes
>> from
>> the
>> ground up. Check out the MappingTool class/docs
>>
>> -----Original Message-----
>> From: linda rae [mailto:lrae@dragon-research.com]
>> Sent: May 16, 2007 8:58 AM
>> To: open-jpa-dev@incubator.apache.org; open-jpa-
>> dev@incubator.apache.org
>> Subject: Will reversemappingTask() generate EJB3 annotations?
>>
>> I apologize if this question has been previously asked and
>> answered. I
>> have
>> googled for an answer with no luck.
>>
>> I have been requested to use OpenJPA on a project. The tool appears
>> straight
>> forward and works well, I have ran the reverse engineering example
>> on my
>> own DB
>> - it works great. However... no EJB3 annotations were generated
>> (@Entity,
>> etc).
>>
>>
>> What configuration option must I define to have the reversemapping
>> tool
>> generate
>> an EJB3 EntityEJB?
>>
>> A short response would be great - any response would would really
>> help (am
>> I
>> asking for something that does not exist?)
>>
>> Thank-you,
>>
>> Linda Rae
>>
>>
>>
Re: Will reversemappingTask() generate EJB3 annotations?
Posted by Michael Dick <mi...@gmail.com>.
That's what I've found too. The reversemapping tool will create new java
files based on the database tables, and provide an orm.xml file. No
annotations though.
You can always add them based on the generated orm.xml file although that
might be easier said than done if you have a lot of entities.
-mike
On 5/16/07, Phill Moran <pj...@rogers.com> wrote:
>
> I am not sure that it will annotate your exiting code but (I think) it
> will make
> an external mapping file for you or generate the annotated classes from
> the
> ground up. Check out the MappingTool class/docs
>
> -----Original Message-----
> From: linda rae [mailto:lrae@dragon-research.com]
> Sent: May 16, 2007 8:58 AM
> To: open-jpa-dev@incubator.apache.org; open-jpa-dev@incubator.apache.org
> Subject: Will reversemappingTask() generate EJB3 annotations?
>
> I apologize if this question has been previously asked and answered. I
> have
> googled for an answer with no luck.
>
> I have been requested to use OpenJPA on a project. The tool appears
> straight
> forward and works well, I have ran the reverse engineering example on my
> own DB
> - it works great. However... no EJB3 annotations were generated (@Entity,
> etc).
>
>
> What configuration option must I define to have the reversemapping tool
> generate
> an EJB3 EntityEJB?
>
> A short response would be great - any response would would really help (am
> I
> asking for something that does not exist?)
>
> Thank-you,
>
> Linda Rae
>
>
>
RE: Will reversemappingTask() generate EJB3 annotations?
Posted by Phill Moran <pj...@rogers.com>.
I am not sure that it will annotate your exiting code but (I think) it will make
an external mapping file for you or generate the annotated classes from the
ground up. Check out the MappingTool class/docs
-----Original Message-----
From: linda rae [mailto:lrae@dragon-research.com]
Sent: May 16, 2007 8:58 AM
To: open-jpa-dev@incubator.apache.org; open-jpa-dev@incubator.apache.org
Subject: Will reversemappingTask() generate EJB3 annotations?
I apologize if this question has been previously asked and answered. I have
googled for an answer with no luck.
I have been requested to use OpenJPA on a project. The tool appears straight
forward and works well, I have ran the reverse engineering example on my own DB
- it works great. However... no EJB3 annotations were generated (@Entity, etc).
What configuration option must I define to have the reversemapping tool generate
an EJB3 EntityEJB?
A short response would be great - any response would would really help (am I
asking for something that does not exist?)
Thank-you,
Linda Rae