openjpa

OpenJPA - Transaction management is not available… (Fuse ESB)

你离开我真会死。 提交于 2019-12-21 20:39:02
问题 I'm having trouble with RESOURCE_LOCAL transaction type for JPA in Fuse ESB. I also don't have a complete understanding of whether JTA or RESOURCE_LOCAL is better for me. My persistence.xml : <persistence-unit name="invoicePersistence" transaction-type="RESOURCE_LOCAL"> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/invDataSource)</jta-data-source> <non-jta-data-source>osgi:service

Nullable Date column merge problem

醉酒当歌 提交于 2019-12-21 19:47:42
问题 I am using JPA with openjpa implementation beneath, on a Geronimo application server. I am also using MySQL database. I have a problem with updating object with nullable Date property. When I'm trying to merge entity with Date property set to null, no sql update script is generated (or when other fields are modified, sql update script is generated, but date field is ommited from it). If date field is set to some other not null value, update script is properly generated. Did anyone have

QueryDSL projections with @ManyToOne relation

末鹿安然 提交于 2019-12-21 18:28:16
问题 I'm using OpenJPA with QueryDSL, I try to avoid manipulating Tuple objects by using the bean projections features of QueryDSL. I have for example these two Entity, with a @ManyToOne relation. @Entity public class Folder { private Long id; private String name; private String path; @ManyToOne @JoinColumn(name = "FK_FILE_ID") private File file; } @Entity public class File { private Long id; private String fileName; } When I'm executing this query : List<Folder> listFolders = query.from(folder)

QueryDSL projections with @ManyToOne relation

人盡茶涼 提交于 2019-12-21 18:27:09
问题 I'm using OpenJPA with QueryDSL, I try to avoid manipulating Tuple objects by using the bean projections features of QueryDSL. I have for example these two Entity, with a @ManyToOne relation. @Entity public class Folder { private Long id; private String name; private String path; @ManyToOne @JoinColumn(name = "FK_FILE_ID") private File file; } @Entity public class File { private Long id; private String fileName; } When I'm executing this query : List<Folder> listFolders = query.from(folder)

IBM Websphere JPA configuration - how to update persistence.xml

最后都变了- 提交于 2019-12-21 17:11:29
问题 I'm new to EJB 3 and the JPA. I've created a datasource in the appserver which is jdbc/AppDataSource . The default persistence provider is left as com.ibm.websphere.persistence.PersistenceProviderImpl . And I left the default jta data source JNDI name as AppDataSource itself. I'm actually confused regarding JTA and non-JTA. What differentiates them? I generated the entities and created an EntityTransaction object in the bean. Upon calling the persist() and commit() methods, I get an error:

setFirstResult and setMaxResult doesn't work well with Order By

99封情书 提交于 2019-12-21 05:54:08
问题 What could cause the CriteriaQuery orderBy method stop working? Here are the implementations: OpenJPAEntityManager kem = OpenJPAPersistence.cast(entityManager()); kem.getFetchPlan().clearFetchGroups(); kem.getFetchPlan().addFetchGroup("order_search"); CriteriaBuilder builder = kem.getCriteriaBuilder(); CriteriaQuery<Order> query = builder.createQuery(Order.class); Root<Order> order = query.from(Order.class); query.select(order); Predicate main_condition = buildWhereClause(builder, query,

can I perform a query inside of JPA entity to get back a single column

China☆狼群 提交于 2019-12-20 05:22:14
问题 I have a dumb question. It would be great if this could be done, but I am not holding my breath. I need a single column from a table linked to my JPA entity to be a collection in said JPA entity. Is there any way, that I can just get back that column alone that is related to that entity, instead of having to get back an entire table (which could be very costly?) Can I perform a query inside that JPA entity that will be performed and loaded eagerly into a collection? I am trying to avoid

How to disable the lock system of JPA?

蓝咒 提交于 2019-12-20 01:36:26
问题 I'm using OpenJPA and I have a lock problem. I already understand what's an OptimisticLockException and when it's thrown. But how can I deal with it ? Below*, you can find a small paragraph about the optimistic lock exceptions. In a nutshell, how I can totally disable the lock manager ? In my persistent.xml, I have the following xml code but it does not work. Why ? ... <properties> <property name="openjpa.LockManager" value="none" /> </properties> ... *According to the wikibooks about the

Does OpenJPA work well with Glassfish?

空扰寡人 提交于 2019-12-19 21:20:28
问题 Is anyone successfully using OpenJPA with Glassfish? I'm trying to use OpenJPA 2.1 with Glassfish 3.1 Open Source. I've followed the instructions to integrate the two here -> http://weblogs.java.net/blog/ss141213/archive/2006/07/using_openjpa_a.html I have a very simple EJB project in Eclipse Indigo with the following: com.rares.test.Person - @Entity com.rares.test.PersonManager - interface com.rares.test.PersonDao - @Stateless However, when I try to deploy I get a ClassNotFoundException on

Does OpenJPA work well with Glassfish?

南笙酒味 提交于 2019-12-19 21:19:23
问题 Is anyone successfully using OpenJPA with Glassfish? I'm trying to use OpenJPA 2.1 with Glassfish 3.1 Open Source. I've followed the instructions to integrate the two here -> http://weblogs.java.net/blog/ss141213/archive/2006/07/using_openjpa_a.html I have a very simple EJB project in Eclipse Indigo with the following: com.rares.test.Person - @Entity com.rares.test.PersonManager - interface com.rares.test.PersonDao - @Stateless However, when I try to deploy I get a ClassNotFoundException on