[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5378?page=c...
]
Jaroslaw Lewandowski commented on HHH-5378:
-------------------------------------------
JPA 2.0 does not mention that order column can't be used on collection annotated with
@OneToMany with no mappedBy="...". Only examples have some comments mentioning
usage of unidirectional relation by this actually is not expressed directly in the text.
Moreover the Hibernate documentation
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections...
is actually using exactly the same example as the one exposed in HHH-5390 as wrong usage
of @OrderColumn
3.5.3: @OrderColumn not updated when inserting
----------------------------------------------
Key: HHH-5378
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5378
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.5.3
Environment: JDK 1.6_20, Hibernate 3.5.3, Spring 3.0.3, Tomcat 7.0.0-beta
Reporter: Jürgen Zimmermann
Assignee: Gail Badner
Attachments: testcase-HHH-5378.zip
I'm having an abstract entity class "AbstractKunde" und a derived class
"Privatkunde" (see below). AbstractKunde references one-to-many the entity class
"Bestellung" and also defines @OrderColumn.
However, when I create a new Bestellung object, then the column for @OrderColumn
isn't updated.
@Entity
@Table(name = "kunde")
@Inheritance
@DiscriminatorColumn(name = "art", length = 1)
...
public abstract class AbstractKunde implements java.io.Serializable {
...
@OneToMany(mappedBy = "kunde")
@OrderColumn(name = "idx")
private List<Bestellung> bestellungen;
...
}
@Entity
@Table(name = "bestellung")
...
public class Bestellung implements java.io.Serializable {
...
@ManyToOne(optional = false)
@JoinColumn(name = "kunde_fk")
@NotNull(message = "{bestellverwaltung.bestellung.kunde.notNull}")
private AbstractKunde kunde;
...
}
@Entity
@DiscriminatorValue("P")
public class Privatkunde extends AbstractKunde {
...
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira