Top "Many-to-one" questions

Cannot make @ManyToOne relationship nullable

I have a many-to-one relationship that I want to be nullable: @ManyToOne(optional = true) @JoinColumn(name = "customer_id", nullable = true) …

jpa-2.0 jboss7.x nullable postgresql-9.1 many-to-one
Hibernate/JPA ManyToOne vs OneToMany

I am reading currently the documentation of Hibernate regarding the entity associations and I come accross a little difficulty to …

hibernate jakarta-ee jpa one-to-many many-to-one
Hibernate Many to one updating foreign key to null

I am trying to get my @OneToMany and @ManyToOne relationships correct. Class 1: @Entity public class IdeaProfile { @Id @GeneratedValue private int …

java hibernate one-to-many many-to-one
Construct JPA query for a OneToMany relation

I've those 2 entities Class A { @OneToMany(mappedBy="a") private List<B> bs; } Class B { @ManyToOne private A a; …

jpa one-to-many many-to-one construct
Doctrine 2 - Disallow null value on foreign keys of ManyToOne relationships

I have a ManyToOne relationship in one of my entities, like so: class License { // ... /** * Customer who owns the license * * @var \…

php doctrine-orm relationship many-to-one
Hibernate @ManyToOne only works with CascadeType.ALL

I am using Hibernate 3.3.1 and i would like to create a relation between persons and an assigned company. They should …

hibernate many-to-one cascading
Doctrine 2 ManyToOne with multiple joinColumns

I'm trying to select the matching row in the product_item_sortorder table based on a productId and toolboxItemId from …

mapping left-join doctrine-orm many-to-one
IllegalStateException with Hibernate 4 and ManyToOne cascading

I've got those two classes MyItem Object: @Entity public class MyItem implements Serializable { @Id private Integer id; @ManyToOne(cascade = {CascadeType.…

java hibernate jpa many-to-one hibernate-cascade
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on <entity> references an unknown entity

I am receiving the following Hibernate Exception: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on cz.rohan.dusps.model.Switchport.konfiguracniTemplateAccess …

java hibernate annotations entity many-to-one
How to create a composite primary key which contains a @ManyToOne attribute as an @EmbeddedId in JPA?

I'm asking and answering my own question, but i'm not assuming i have the best answer. If you have a …

jpa jpa-2.0 composite-key many-to-one