Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Question regarding odd behavior of EclipseLink with Derby

Hi Gopi,

Could you turn on logging and send the logged SQL from both your Derby and PostGreSQL test cases? (persistence unit property: eclipselink.logging.level=FINEST)

  Please also include the full stack trace from the exception in Derby.

-Tom

Gopi Kandaswamy wrote:
Hi all,

I am using EclipseLink 2.1.0 and when I run my code against a Derby database, I get the following error message. Basically this is what is happening...

a) I have a class called 'Service' (maps to database table called physical_endpoints) which has a many-to-one relationship to a database table called logical_endpoints. So the orm.xml for physical_endpoints looks like this...

<entity class="Service">
	<table name="physical_endpoints" />
	<attributes>
	.
	.
	.	
	<many-to-one name="endpoint">
       	<join-column name="logical_id" />
	</many-to-one>
       </attributes>
</entity>

As you can see, I have specified a <join-column name="logical_id">. I have not specified a <join-table name="the_join_table_name"> because such a join table does not exist and I do not want such a table to be created automatically by JPA. But when I run my code, EclipseLink tries to insert records into the join table for the above relationship. The join table for the above relation does not exist and hence the error below. The weird thing here is that when I use PostgreSQL database instead of Derby database, the following exception does not occur. In other words, the error occurs when I use EclipseLink + Derby and not EclipseLink + PostgreSQL.

Does anyone have any ideas? The error below occurs when I persists (em.persist(service)) to the database.

Thanks

Gopi

=======Exception=========
Internal Exception: java.sql.SQLSyntaxErrorException: Table/View 'LOGICAL_ENDPOINTS_PHYSICAL_ENDPOINTS' does not exist.
Error Code: 20000
Call: INSERT INTO logical_endpoints_physical_endpoints (services_id, Endpoint_id) VALUES (?, ?)
	bind => [1, 1]
Query: DataModifyQuery(sql="INSERT INTO logical_endpoints_physical_endpoints (services_id, Endpoint_id) VALUES (?, ?)")
=========================_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top