eclipselink

JPA: Circular relations: diff between EclipseLink and Hiberante

≡放荡痞女 提交于 2020-02-23 06:31:06
问题 We have an entity Role which could be either users or groups. In the groups we have set permissions. Therefore a user belongs to a group. Additionally groups can belong to other groups, i.e. one could make a hierarchy of permissions. The idea is to store the relations from e.g. user -> group into a separate db table role_ref . @Table(name = "role__parent") @IdClass(RoleAssociationKey.class) @Data public class RoleAssociation implements Serializable { @Id @JoinColumn(name = "has_parent_role_id

org.eclipse.persistence.exceptions.ConversionException

 ̄綄美尐妖づ 提交于 2020-02-08 02:33:40
问题 I am a beginner of eclipselink and persistence, i am using @EmbeddedId like this with javafx properties.... @Entity public class Inwards implements Serializable{ Destination id; StringProperty orderName; IntegerProperty orderNo; ObjectProperty<LocalDate> orderDate; BooleanProperty save; public Inwards(){ this.orderName = new SimpleStringProperty(); this.orderNo = new SimpleIntegerProperty(); this.orderDate = new SimpleObjectProperty<LocalDate>(LocalDate.of(2015, Month.MARCH, 5)); this.save =

JPA EclipseLink uses a non-entity as target entity in the relationship attribute

*爱你&永不变心* 提交于 2020-02-05 14:06:41
问题 I get the following error when i try to deploy my application on glassfish 4.1: [class com.sample.model.Profile] uses a non-entity [class com.sample.model.ProfileEventMapping] as target entity in the relationship attribute [field events]. The tables for both entities are getting created in the database. Profile: @Entity public class Profile ... @OneToMany(mappedBy = "profile", orphanRemoval = true) private Set<ProfileEventMapping> events = new HashSet<>(); ProfileEventMapping: @Entity public

JPA EclipseLink uses a non-entity as target entity in the relationship attribute

依然范特西╮ 提交于 2020-02-05 14:01:40
问题 I get the following error when i try to deploy my application on glassfish 4.1: [class com.sample.model.Profile] uses a non-entity [class com.sample.model.ProfileEventMapping] as target entity in the relationship attribute [field events]. The tables for both entities are getting created in the database. Profile: @Entity public class Profile ... @OneToMany(mappedBy = "profile", orphanRemoval = true) private Set<ProfileEventMapping> events = new HashSet<>(); ProfileEventMapping: @Entity public

JPA EclipseLink uses a non-entity as target entity in the relationship attribute

自闭症网瘾萝莉.ら 提交于 2020-02-05 13:58:02
问题 I get the following error when i try to deploy my application on glassfish 4.1: [class com.sample.model.Profile] uses a non-entity [class com.sample.model.ProfileEventMapping] as target entity in the relationship attribute [field events]. The tables for both entities are getting created in the database. Profile: @Entity public class Profile ... @OneToMany(mappedBy = "profile", orphanRemoval = true) private Set<ProfileEventMapping> events = new HashSet<>(); ProfileEventMapping: @Entity public

JPA EclipseLink uses a non-entity as target entity in the relationship attribute

♀尐吖头ヾ 提交于 2020-02-05 13:54:26
问题 I get the following error when i try to deploy my application on glassfish 4.1: [class com.sample.model.Profile] uses a non-entity [class com.sample.model.ProfileEventMapping] as target entity in the relationship attribute [field events]. The tables for both entities are getting created in the database. Profile: @Entity public class Profile ... @OneToMany(mappedBy = "profile", orphanRemoval = true) private Set<ProfileEventMapping> events = new HashSet<>(); ProfileEventMapping: @Entity public

Java-EE6: FetchType.LAZY with static weaving throws strange exception

与世无争的帅哥 提交于 2020-02-02 08:51:19
问题 My Solution consists of 3 different projects: EJB project with Netbeans auto-generated Facades to manage Entity classes and the persistence.xml Class-Library that holds all @Entity annotated and statically weaved database classes and the remote interfaces for the facade ejb's (shared between EJB and stand-alone client) Stand-alone Client that consists mainly of Swing GUI classes I use Glassfish 3.1.2, Eclipselink 2.3 as JPA-provider, Netbeans 7.1.1 and a MySQL database. I configured an Ant

Java-EE6: FetchType.LAZY with static weaving throws strange exception

杀马特。学长 韩版系。学妹 提交于 2020-02-02 08:49:06
问题 My Solution consists of 3 different projects: EJB project with Netbeans auto-generated Facades to manage Entity classes and the persistence.xml Class-Library that holds all @Entity annotated and statically weaved database classes and the remote interfaces for the facade ejb's (shared between EJB and stand-alone client) Stand-alone Client that consists mainly of Swing GUI classes I use Glassfish 3.1.2, Eclipselink 2.3 as JPA-provider, Netbeans 7.1.1 and a MySQL database. I configured an Ant

Update Entity Relationship via UPDATE .. SET Query

邮差的信 提交于 2020-01-25 07:37:10
问题 I have two entities: class A { @OneToMany(mappedBy = "a") List<B> bs; // getter/ setter } class B { @ManyToOne A a; // getter/ setter } To delete one b, I first need to invalidate that relationship. "Traditionally" I would do something like that: A a = em.getReference(A.class, entityIdA) B b = em.getReference(B.class, entityIdB); a.getBs().remove(b); b.setA(null); em.remove(b); This is not very performant, if the List of a 's is getting large (a few hundreds in my case). I know I can also use

Update Entity Relationship via UPDATE .. SET Query

∥☆過路亽.° 提交于 2020-01-25 07:37:05
问题 I have two entities: class A { @OneToMany(mappedBy = "a") List<B> bs; // getter/ setter } class B { @ManyToOne A a; // getter/ setter } To delete one b, I first need to invalidate that relationship. "Traditionally" I would do something like that: A a = em.getReference(A.class, entityIdA) B b = em.getReference(B.class, entityIdB); a.getBs().remove(b); b.setA(null); em.remove(b); This is not very performant, if the List of a 's is getting large (a few hundreds in my case). I know I can also use