Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » em.remove throws exception: identifier is too long(em.remove throws exception: identifier is too long)
em.remove throws exception: identifier is too long [message #632812] Thu, 14 October 2010 10:53 Go to next message
Deepak  is currently offline Deepak Friend
Messages: 2
Registered: October 2010
Junior Member
I have a header(user_header_test) and a detail(user_detail_test) table, where the header table has one-to-many relationship with the detail table. when i want to find and delete the header using EntityManager, it fails. I see that in the generated SQL, the table name has header table name appended with detail table name(i.e DELETE FROM USER_HEADER_TEST_USER_DETAIL_TEST WHERE ..). What I may be doing wrong?. Thanks.
I am using EclipseLink 2.1.1

code snippet:

@Table(name = "user_header_test")
public class UserHeader implements Serializable {

@Column(name = "APP_ID", length = 1000)
private String appId;

@Column(name = "USER_ID", length = 1000)
private String userId;

@OneToMany(mappedBy = "userHeader", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private Collection<UserDetail> members = new ArrayList<UserDetail>();


@Table(name = "user_detail_test")
public class UserDetail implements Serializable {

@Column(name = "ID")
private int id;

@Column(name = "USER_ADDRESS", length = 1000)
private String address;

@JoinColumns( { @JoinColumn(name = "APP_ID",
referencedColumnName = "APP_ID"),
@JoinColumn(name = "USER_ID",
referencedColumnName = "USER_ID") })
private UserHeader userHeader;


public class JPATest {

private static EntityManagerFactory emf;
private static EntityManager em;

UserHeader userHeader = em.find(...);
// The above fails with the exception
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long

Error Code: 972
bind => [app,12345]
Re: em.remove throws exception: identifier is too long [message #632840 is a reply to message #632812] Thu, 14 October 2010 12:51 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1190
Registered: July 2009
Senior Member

The error indicates that EclipseLink believes there is a ManyToMany or unidirectional OneToMany on the UserHeader class to UserDetail, and it is using a default relation table. I would recommend you set the EclipseLink log level to finest, and check the logs for when the UserHeader class is being processed. Could you be using an orm.xml file, or have annotations on the methods in the UserHeader class? Annotations on the methods might cause the field level annotations to be ignored.

Best Regards,
Previous Topic:JPQL query does not locate the constructor correctly
Next Topic:Using a fetch group with find
Goto Forum:

Current Time: Thu Oct 27 03:33:36 GMT 2016

Powered by FUDForum. Page generated in 0.02154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software