You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by jeff <je...@yahoo.com> on 2007/03/16 18:43:58 UTC

schema generation, OpenJPA vs. Toplink

i'm new here, so please excuse if this is a stupid question ...

from my cursory look at OpenJPA, it seems that it takes a different approach to schema generation than TopLink.

Toplink generates a schema from annotations, where OpenJPA requires one to provide a DB-neutral XML schema file. do i have that right?

i am trying to understand the advantages of OpenJPA's approach. from my naive standpoint right now, it seems less than optimal. if the metadata is already captured in annotations, why require it to be defined in the schema XML file?

am i missing something?
thanks.



 
---------------------------------
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.

RE: schema generation, OpenJPA vs. Toplink

Posted by Patrick Linskey <pl...@bea.com>.
Jeff,

Just to clarify, OpenJPA does support directly creating a DDL file or
altering a schema from the information that you provide in annotations.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On 
> Behalf Of Marc Prud'hommeaux
> Sent: Friday, March 16, 2007 10:48 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: schema generation, OpenJPA vs. Toplink
> 
> Jeff-
> 
> OpenJPA provides the ability to generate a schema to an intermediate  
> XML file, but it doesn't require it. You can also create the schema  
> directly against the database.
> 
> Using the intermediate XML file can be useful if you want to 
> generate  
> the schema, but then make additional modifications to it 
> (like adding  
> indexes) before actually building the schema against the 
> database. It  
> can also be useful to capture the schema locally, since OpenJPA can  
> be configured to validate mappings against the schema file rather  
> than validating it against database metadata (which can sometimes be  
> slow).
> 
> For example scenarios for using the mappingtool, see:
> 
>    http://incubator.apache.org/openjpa/docs/latest/manual/ 
> manual.html#ref_guide_mapping_mappingtool_examples
> 
> 
> 
> On Mar 16, 2007, at 10:43 AM, jeff wrote:
> 
> > i'm new here, so please excuse if this is a stupid question ...
> >
> > from my cursory look at OpenJPA, it seems that it takes a 
> different  
> > approach to schema generation than TopLink.
> >
> > Toplink generates a schema from annotations, where OpenJPA 
> requires  
> > one to provide a DB-neutral XML schema file. do i have that right?
> >
> > i am trying to understand the advantages of OpenJPA's approach.  
> > from my naive standpoint right now, it seems less than optimal. if  
> > the metadata is already captured in annotations, why require it to  
> > be defined in the schema XML file?
> >
> > am i missing something?
> > thanks.
> >
> >
> >
> >
> > ---------------------------------
> > Expecting? Get great news right away with email Auto-Check.
> > Try the Yahoo! Mail Beta.
> 
> 

Re: schema generation, OpenJPA vs. Toplink

Posted by Marc Prud'hommeaux <mp...@apache.org>.
Jeff-

OpenJPA provides the ability to generate a schema to an intermediate  
XML file, but it doesn't require it. You can also create the schema  
directly against the database.

Using the intermediate XML file can be useful if you want to generate  
the schema, but then make additional modifications to it (like adding  
indexes) before actually building the schema against the database. It  
can also be useful to capture the schema locally, since OpenJPA can  
be configured to validate mappings against the schema file rather  
than validating it against database metadata (which can sometimes be  
slow).

For example scenarios for using the mappingtool, see:

   http://incubator.apache.org/openjpa/docs/latest/manual/ 
manual.html#ref_guide_mapping_mappingtool_examples



On Mar 16, 2007, at 10:43 AM, jeff wrote:

> i'm new here, so please excuse if this is a stupid question ...
>
> from my cursory look at OpenJPA, it seems that it takes a different  
> approach to schema generation than TopLink.
>
> Toplink generates a schema from annotations, where OpenJPA requires  
> one to provide a DB-neutral XML schema file. do i have that right?
>
> i am trying to understand the advantages of OpenJPA's approach.  
> from my naive standpoint right now, it seems less than optimal. if  
> the metadata is already captured in annotations, why require it to  
> be defined in the schema XML file?
>
> am i missing something?
> thanks.
>
>
>
>
> ---------------------------------
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.