java - Hibernate doesn't use the name argument for @JoinTable -


I have a small problem, I have a superclass that defines the unit in a root table in PostGraySQL.

  @Entity @Inheritance (strategy = InheritanceType: p> This class 2 inherits table / square unit, where I have a  @OneToOne  table union is to add to join. TABLE_PER_CLASS) @Table (name = "equipement") public abstract class Equipement {....} @ entity @Table (name = "nod") public class node Equipement extended {safety Cross; @OneToOne (cascade = CascadeTypekALL, optional = true, bringing = FetchType.EAGER) @JoinTable (name = "assoc_nod_cross", joinColumns = @JoinColumn (name = "nod_id", referencedColumnName = "ID"), inverseJoinColumns = @ JoinColumn (name = "cross_id", referenced column name = "id")) public cross mill cross () {return cross; } ...} @ Entity @Table (name = "cross") public class cross equipment extended {secure sanction; @OneToOne (cascade = CascadeTypekALL, optional = true, bringing = FetchType.EAGER) @JoinTable (name = "assoc_nod_cross", joinColumns = @JoinColumn (name = "cross_id", referencedColumnName = "ID"), inverseJoinColumns = @ JoinColumn (name = "nid_id", referenced column name = "id")) public node getNod () {return reject; } ...}  

When listing all nodes or cross entities, hibernate wants to search for inverse JoinColumns field in the wrong table, not using this name (assoc_nod_cross) I even put anything

sample:.

  Hibernate: org.hibernate: cross0_.id selected as id1_7_, cross cross0_ cross0_.nod_id as nod_id2_1_ the javax.persistence.PersistenceException. exception.SQLGrammarException: org.postgresql.util.PSQLException: ResultSet can not isolate ... because the error column cross0_.node_id  is not 

a problem because Is Heritage Strategy? Is this a bug in hibernate? Is this a problem in the definition of my institutions?

Added information: I tried to switch to EclipseLink to see if it is a bug / boundary in a hibernation or if I am wrong and EclipseLink works well.

Is there a bidirectional relationship between cross and node ? If so, in this regard you do not have to annotate it on both sides of the relationship. It is possible that this hibernate is misleading. It is an example of working on it. I think it should be done.

@tainty (name = "nod") public class approval Equipement Cross; @OneToOne (cascade = CascadeTypekALL, optional = true, bringing = FetchType.EAGER) @JoinTable (name = "assoc_nod_cross", joinColumns = @JoinColumn (name = "Nod_id", ReferencedColumnName = "ID"), InverseJoinColumns = @JoinColumn (name = "cross_id", referenced column name = "id")) public cross mill cross () {return cross;} ...} @ entity @table (name = "Cross") Public Square Cross Equipment Expanded {Secure Needs Approval; @OneToOne (Mapped = "Cross") Public Node getNod () {Return Approval;} ...}

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -