1. How can I ask Hibernate to create an index on a foreign key (JoinColumn)? stackoverflow.comclass User{
|
2. JoinColumn name not used in sql stackoverflow.comI have a problem with mapping many-to-one relationship without exact foreign key constraint set in database. I use OpenJPA implementation with MySql database, but the problem is with generated sql scripts ... |
3. JPA - Can an @JoinColumn be an @Id as well? SerializationException occurs stackoverflow.comI am trying to use an @JoinColumn as an @Id using JPA and I am getting SerializationExceptions, "Could not serialize." UserRole.java:
|
4. @OneToOne and @JoinColumn, auto delete null entity , doable? stackoverflow.comI have two Entities , with the following JPA annotations :
|
5. JPA Entities with JoinColumn of two columns stackoverflow.comI have this escenario... I have three 4 entities {orderItem, suppliers, supplier, prices}, and they are related like:
|
6. JPA: difference between @JoinColumn and @PrimaryKeyJoinColumn? stackoverflow.comWhat's the exact difference between @JoinColumn and @PrimaryKeyJoinColumn? You use @JoinColumn for columns that are FKs. A typical column could look like (e.g. in a join table with additional attributes):
|
7. How to handle @JoinColumn in your own NamingStrategy implementation? stackoverflow.comI thought that |
8. Why is JPA choosing String for JoinColumn regardless of key types? stackoverflow.comUsing the EclipseLink JPA2 implementation (not sure if it's the same with the Hibernate implementation) I have a simple structure where an Organization entity has contracts. Here's the sql I exported ... |
9. JPA: is @PrimaryKeyJoinColumn(...) the same as @JoinColumn(..., insertable = ?, updatable = ?)? stackoverflow.comCan you derive from the JPA spec, if
or
|
10. EclipseLink: multi-column, one-to-one, JPA 2.0 @EmbeddedId using @MapsId fails with read-only on @JoinColumn (derived identities compared) stackoverflow.comI have the following design: Simple logic: Foos uses a multi-column PK to PostAddresses using the same columns (same key). Here are the JPA 2.0 @EmbeddedId mappings (using a nested ... |
11. Setting JoinColumn parameters insertable and updatable to null stackoverflow.comI have seen a couple of examples on the Internet about using JoinColumn like the way in the example below. Actually, there are two questions I want to ask you about this ... |
12. JPA Nullable JoinColumn stackoverflow.comI have an entity:
|
13. using @ManyToMany relationship without @JoinColumn stackoverflow.comi just want to know the difference between using @ManyToMany relationship wit @JoinColumn and using it without @JoinColumn |
14. JPA2 JoinColumns JoinColumn name is not being respected. (Hibernate 3.6 and H2) stackoverflow.comHere is the reduced snippet, omitting the IdClass details. The issue I am having is the tables definition is:
|
15. JPA2:i use a JoinColumn as queryparam to create a query and a exception occurred ,why stackoverflow.com
|
16. @OneToOne(optional=false) and @JoinColumn(nullable=false) used together stackoverflow.comI've bumped into this example in JPA 2.0 FR Specification, 11.1.37. OneToOne Annotation, page 403:
Is there any reason that I should put ... |
17. [JPA] Benefit of @JoinColumn on @ManyToOne coderanch.com |
19. @JoinColumn(nullable = false) necessary? forum.hibernate.orgI read that when you have an @ManyToOne mapping you should underneath it put @JoinColumn(nullable = false). Is it valid to do this even if you arent specifying a column for the join column? Also kinds of situations does this kind of check help? Only one I can think of is if you create the ManyToOne child object and then you ... |
20. @OneToOne and @JoinColumn, auto delete null entity , doable? forum.hibernate.org@Entity @Table(name = "Owner") public class Owner implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private long id; @OneToOne(fetch=FetchType.EAGER , cascade=CascadeType.ALL) @JoinColumn(name="Data_id") private Data Data; } @Entity @Table(name = "Data") public class Data implements Serializable { @Id private ... |
21. Simple Bidirectional OneToOne with JoinColumn not working forum.hibernate.orgHibernate Version 3.5.0.Final (with patch from http://opensource.atlassian.com/projects/hibernate/browse/HHH-3824) I've been trying to map a bidirectional @OneToOne association using a @JoinColumn on a non-primary key, without much luck so far. It seems to me that the functionality is missing right now, as somebody supplied a patch to implement the functionality. Even with the patch I couldn't get it to work though. The association ... |
22. mappedBy vs JoinColumn and an IndexColumn forum.hibernate.orgI have a OneToMany association between two entities: Newsletter and Section. The order of the Sections within the Newsletter is important and needs to be persisted and I'm using the IndexColumn annotation. Newsletter and Section code snippets are as follows. Newsletter: @OneToMany(mappedBy="newsletter") @IndexColumn(name="sequence") private List |
23. Hibernate not honoring table attribute of @JoinColumn forum.hibernate.orgNewbie Joined: Thu Jul 16, 2009 8:05 am Posts: 1 In my understanding the "table" attribute of the @JoinColumn annotation identifies in what table the join column resides. Hibernate (3.3.2.GA / Oracle) however does not seem to take note of that. Here is a simplified version of my problem mapping: Code: -- DDL (Oracle) : CREATE TABLE demo_config ( ... |
24. What is the difference between mappedby and joincolumn in on forum.hibernate.org |
25. why @OneToOne( mappedBy ) not using mappedBy's @JoinColumn ? forum.hibernate.orgclass A { @Id private long id; private long aUniqueId; @OneToOne( mappedBy="a") private B b; } class B { @Id private long id; private long bUniqueId; @OneToOne @JoinColumn( name="aId", referencedColumnName="aUniqueId" ) ... |
26. table attribute in @JoinColumn causes annotation exception forum.hibernate.orgNewbie Joined: Wed Feb 02, 2011 10:05 am Posts: 1 Hi, I am running into a strange issue. I am using intelliJ IDEA to automatically create annotated classes from a simple (personal tutorial) database schema consisting of three tables: address, state and country. The three annotated classes are generated accordingly (and according to the api), but when I try to create ... |
27. Audited class with JoinColumn referencedColumnName not pk forum.hibernate.orgHi all, I have a Audited class with a @ManyToOne join between two tables using a non pk column, like this: Code: @Audited @Entity public class A { @Id @GeneratedValue private long id; @ManyToOne ... |
28. JoinColumn: using Parent class field forum.hibernate.org@Entity @Table(name="TABLE2") @PrimaryKeyJoinColumn(name = "ID") class SubClass extends Parent{ ... ... /** *A List of CompositeElement objects. ... |
29. Cast and joincolumn forum.hibernate.org |
30. @JoinColumn settings forum.hibernate.org |
31. Joincolumn vs Jointable forum.hibernate.org |
32. ManyToOne(optional=true) VS JoinColumn( nullable = true) forum.hibernate.org |
33. How to specify a constant value for a JoinColumn? forum.hibernate.orgThis seems like a pretty common thing to want to do but I haven't seen any example of how to accomplish this: Basically, I want to have a JoinColumns annotation where I specify a constant value for one of the columns. Here's a simple example to illustrate... basically I want to bind a Person object's homeAddress value to the Address table ... |
34. JoinColumn not-nullable for manyToOne and oneToOne forum.hibernate.orgThis question comes up from time to time in the Hibernate forums. According to Gavin King, one of the men behind Hibernate, the way to do this is to map 0 to null is to write a UserType that transforms 0 to null, and use that custom UserType as the identified type. Hibernate will not create a schema with default values, ... |
35. @Any does not work: @Any requires an explicit @JoinColumn(s) forum.hibernate.org@Entity public class MyEntity implements Serializable { ... private Property mainProperty; @Any(metaColumn = @Column(name = "property_type"), fetch = FetchType.EAGER) @AnyMetaDef(idType = "integer", metaType = "string", metaValues = { @MetaValue(value = "S", targetEntity = StringProperty.class), @MetaValue(value = "I", targetEntity = IntegerProperty.class) } ) ... |
36. JPA / Hibernate delete_orphan while joincolumn updatable forum.hibernate.orgHibernate cannot find the entity it's about to delete when I'm using the delete_orphan annotation in combination with an updatable foreign key. Both entities are versioned for optimistic locking. When I inspect hibernates sql it seems it first updates the child entity by setting to foreign key to null. Afterwards the delete_orphan is doing it's work with the resulting delete statement. ... |
37. order of @JoinColumn annotations seems to matter forum.hibernate.org |
38. @JoinColumn doesn't gewnerate foreign key constraints forum.hibernate.orgspecs: hibernate 3.3.1.ga, anno 3.4.0.ga, em 3.4.0.ga Hi, First of all, I have read a lot of docs (maybe I missed something :( ). Does referencedColumnName attribute of @JoinColumn need to refer only to an ID of an entity to generate a foreign key? What if I want to refer to a unique key but is not an ID (but a ... |