openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reinis Vicups (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OPENJPA-1607) Using unidirectional one-to-many target foreign key throws exception
Date Mon, 18 Nov 2013 14:01:20 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13786296#comment-13786296
] 

Reinis Vicups edited comment on OPENJPA-1607 at 11/18/13 1:59 PM:
------------------------------------------------------------------

Working with openjpa-2.3.0-SNAPSHOT and getting this error UNLESS

if I substitute @JoinColumn with @org.apache.openjpa.persistence.jdbc.ElementJoinColumn this
particular exception goes away and following exception is thrown instead:

Caused by: <openjpa-2.3.0-SNAPSHOT-r422266:1535082 nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
java.util.HashMap$KeySet
	at org.apache.openjpa.util.Serialization.serialize(Serialization.java:67)
	at org.apache.openjpa.jdbc.sql.DBDictionary.serialize(DBDictionary.java:1518)
	at org.apache.openjpa.jdbc.sql.DBDictionary.setBlobObject(DBDictionary.java:1018)
	at org.apache.openjpa.jdbc.sql.DBDictionary.setTyped(DBDictionary.java:1345)
	at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:896)
	at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:856)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:117)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:79)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:100)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:88)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:357)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flushGraph(ConstraintUpdateManager.java:349)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:97)
	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:105)
	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:78)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:732)
	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
	at org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:661)
	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
	... 64 more


was (Author: reinis_v):
Working with openjpa-2.3.0-SNAPSHOT and getting this error UNLESS

if I substitute @JoinColumn with @org.apache.openjpa.persistence.jdbc.ElementJoinColumn this
particular exception goes away!

> Using unidirectional one-to-many target foreign key throws exception
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-1607
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1607
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta3
>            Reporter: Oliver Ringel
>         Attachments: openjpa-1607.tar
>
>
> Using this simple unidirectional relationship
> @OneToMany
> @JoinColumn(name = "DEPARTMENT_ID")
> private Set<Employee> employees;
> causes to the following exception
> <openjpa-2.0.0-beta3-r422266:926797 fatal user error> org.apache.openjpa.persistence.ArgumentException:
You have supplied columns for "com.example.Department.employees", but this mapping cannot
have columns in this context.
> Unidirectional one-to-many target foreign key relationship should be supported in JPA
2.0.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message