jpa-2.0

entity with relationships through GWT RPC problem

删除回忆录丶 提交于 2019-12-19 10:41:01
问题 I am using JPA 2.0. (EclipseLink 2.0.2) If an entity contains relations, for example: @OneToMany(cascade = CascadeType.ALL, mappedBy = "userId") private Collection<Blog> blogCollection; I am getting the following error when I am sending it through RPC: com.google.gwt.user.client.rpc.SerializationException: Type 'org.eclipse.persistence.indirection.IndirectList' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For

jpa fetch join query

拟墨画扇 提交于 2019-12-19 10:26:39
问题 This is how my domain looks: public class Template implements Serializable { private static final long serialVersionUID = 1L; @OneToOne(cascade=CascadeType.ALL) private FieldConfig fieldConfig; } public class FieldConfig implements Serializable { private static final long serialVersionUID = 1L; @OneToMany(cascade= CascadeType.PERSIST) @JoinColumn(name = "fieldConfigId") private Set<Field> fieldSet; } I want to achieve if I load a template from the db that automatically the fieldConfig is

Datanucleus JPA 2 Level 2 cache in Google AppEngine

你离开我真会死。 提交于 2019-12-19 10:25:23
问题 What am I missing in the following configuration that my Datanucleus JPA 2 Level 2 cache is not using Google App Engine Memcache service? I am using the GAE 1.7.2 SDK. In the persistence.xml: <persistence-unit name="transactions-optional"> <provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider> <properties> <property name="datanucleus.NontransactionalRead" value="true"/> <property name="datanucleus.NontransactionalWrite" value="true"/> <property name="datanucleus.ConnectionURL"

NULL ID Generated Via @GeneratedValue On Composite Key Using @EmbeddedId

痞子三分冷 提交于 2019-12-19 07:59:46
问题 Trying to save a row in a table that has a composite key (Long & Date) via Spring Data JPA. The Long part of the composite key is @GeneratedValue. But I'm getting the following error when doing a basic save() call: org.hibernate.id.IdentifierGenerationException: null id generated for:class com.bts.billing.domain.CashBatchPaymentHistoryDto The date is getting set manually prior to the save() and I've validated the sequencer exists in the database and is accessible. Entity @Entity @Table(name =

NULL ID Generated Via @GeneratedValue On Composite Key Using @EmbeddedId

半世苍凉 提交于 2019-12-19 07:59:28
问题 Trying to save a row in a table that has a composite key (Long & Date) via Spring Data JPA. The Long part of the composite key is @GeneratedValue. But I'm getting the following error when doing a basic save() call: org.hibernate.id.IdentifierGenerationException: null id generated for:class com.bts.billing.domain.CashBatchPaymentHistoryDto The date is getting set manually prior to the save() and I've validated the sequencer exists in the database and is accessible. Entity @Entity @Table(name =

JPA persistence using multiple threads

那年仲夏 提交于 2019-12-19 04:14:16
问题 I have a problem when I try to persist objects using multiple threads . Details : Suppose I have an object PaymentOrder which has a list of PaymentGroup (One to Many relationship) and PaymentGroup contains a list of CreditTransfer (One to Many Relationship again). Since the number of CreditTransfer is huge (in lakhs), I have grouped it based on PaymentGroup (based on some business logic) and creating WORKER threads(one thread for each PaymentGroup) to form the PaymentOrder objects and commit

JBoss 5.1: Hibernate with JPA

寵の児 提交于 2019-12-19 03:08:10
问题 I've got two questions to ask regarding JBoss 5.1. We are in process of migrating from JBoss 4.2 to JBoss 5.1. We are also using Java 1.6 and JPA 2.0 with Hibernate 3.6 as the provider. My questions are: Is it possible to use Hibernate 3.6+ with JBoss 5.1. If yes, then how? What about JPA 2.0? I know that JBoss 5.1 comes with JPA 1.0 compatibility. Can we use JPA2? And as we can not do any kind of configuration to the JBoss installation, all the fixes need to be done in our application only.

JPA @Version behaviour

我们两清 提交于 2019-12-18 20:48:04
问题 im using JPA2 with Hibernate 3.6.x I have made a simple testing on the @Version. Let's say we have 2 entities, Entity Team has a List of Player Entities, bidirectional relationship, lazy fetchtype, cascade-type All Both entities have @Version And here are the scenarios : Whenever a modification is made to one of the team/player entity, the team/player's version will be increased when flushed/commited (version on the modified record is increased). Adding a new player entity to team's

HIBERNATE - JPA2 - H2 - Querying @ElementCollections HashMap by key

走远了吗. 提交于 2019-12-18 17:43:33
问题 I'm using hibernate-entitymanager 3.6.4.Final and h2 database 1.3.155 I'm using the H2Dialect. I'm having trouble filtering records by elements in an @ElementCollection. Here is my entity @Entity public class Item { @Id @GeneratedValue(strategy = GenerationType.AUTO) @MapKeyColumn(name="name", length=50) @Column(name="value", length=100) protected Map<String, String> attributes; /* etc. */ } Here is my query : Item item = em.createQuery("FROM Item i JOIN i.attributes a WHERE KEY(a)=

Using JPA2 in Tomcat 6: @PersitenceContext doesn't work, EntityManager is null

送分小仙女□ 提交于 2019-12-18 16:35:53
问题 I am using JSF2 with Pure JPA2. But the problem is with entityManager, @PersistenceContext private EntityManager entityManager; Here entityManager is not getting injected and always null. Can some one please help me what is wrong in my code. Here is my configuration. User.java @Entity @Table(name="USER") public class User { private int id; private String name; private String surname; @Id @SequenceGenerator(name="user_id_seq_gen", sequenceName="USER_ID_GEN_SEQ", allocationSize=1)