Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Issue with generated DDL

The default column names are defined in the JPA spec.  If you column name is
too long for your database, then you need to specify the column name using
@Column or @JoinColumn.


NBW wrote:
> 
> Hi Peter,
> 
> The name for the join table itself isn't too long in this case. It's the
> column names on that table and their associated usage in the fk
> constraints that are too long.  Are those column names also governed by
> the JPA spec? 
> 
> -Noah
> 
> 
> On May 30, 2012, at 5:00 PM, Peter Krogh wrote:
> 
>> I believe that there is code in place that does indeed take database size
>> limitations into account when generating the fk constraint names, so i am
>> surprised to see that this is an issue   
>> 
>> The name that is chosen for the relation table (I believe) is governed by
>> the Jpa spec.  
>> 
>> This message was composed by Peter's thumb. 
>> 
>> On 2012-05-30, at 4:49 PM, Noah White <emailnbw@xxxxxxxxx> wrote:
>> 
>>> Hi folks,
>>> 
>>> I am using Eclipselink 2.3.2v20111125-r10461 bundled with Glassfish
>>> 3.1.2. In my persistence.xml I set among other properties:
>>> 
>>> <property name="eclipselink.target-database" value="Oracle"/>
>>> <property name="eclipselink.jdbc.native-sql" value="true"/>
>>> 
>>> One of my Entity classes has a @OneToMany relationship. The property
>>> name is kind of long. If I allow Eclipselink to perform auto DDL
>>> generation it tries to create a join table with row names and constraint
>>> names which are longer then 30 characters which for Oracle is too long
>>> and results in a:
>>> 
>>> ORA-00972: identifier is too long 
>>> 
>>> I expect that if I specify a target DB Eclipselink would be smart enough
>>> to take into consideration platform specific issues such as max. column
>>> name length when generating the DDL.
>>> 
>>> Any thoughts on why this is not the case?
>>> 
>>> Thanks,
>>> 
>>> -Noah
>>> 
>>> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.eclipse.org/forums/index.php?t=thread&frm_id=111&S=1b00bfd151289b297688823a00683aca
EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Issue-with-generated-DDL-tp33934645p33937967.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top