eclipselink

Batch Fetch is not working in EclipseLink

主宰稳场 提交于 2019-12-08 01:04:13
问题 Consider this simple association: @Entity public class Employee { @OneToMany(fetch=FetchType.LAZY) private Set<Address> addresses; } Using this code the addresses are not fetched in the result: Query query=entityManager.createQuery("select e from Employee e"); query.setHint("eclipselink.batch.type", "JOIN"); query.setHint("eclipselink.batch", "e.addresses"); List list=query.getResultList(); While in this one the addresses are fetched: Query query=entityManager.createQuery("select e from

JPA with EclipseLink and Java SE

房东的猫 提交于 2019-12-07 19:53:30
问题 After exporting the project jar file to the fileserver the creation of the entitymanager of jpa does not work anymore. There is following details: I use EclipseLink from Glassfishv3 Project I downloaded EclipseLink 2.4... from the website. org.eclipse.persistence.core.jar, org.eclipse.persistence.jpa.jar, javax.persistence.jar and eclipselink.jar are in the lib folder. persistence.xml is in META-INF folder inside src. (I use eclipse helios) this is the content of the persistence.xml <?xml

EclipseLink static weaved entities breaks remove of an entity operation

二次信任 提交于 2019-12-07 19:53:14
问题 I successfully performed static weaving in EclipseLink-2.4.0 with eclipselink-staticweave-maven-plugin 1.0.3 , but when I also run integration tests. going through all layers in the system, they breaks. In startUp() method I create it's created an User entity which it's committed in the test DB. But in tearDown() method where I clear the DB state that entity (already weaved) could not be removed by same EntityManager. The test goes without errors when entities are not weaved. What do you

EclipseLink dynamic MOXy accessing enum values

五迷三道 提交于 2019-12-07 16:06:54
问题 I'm using the XSD listed below and a corresponding XML. Everything works well with dynamic MOXy but I haven't any idea how to access the enum type within java. Any suggestions? Thanks for help. <?xml version="1.0" encoding="UTF-8"?> <xs:schema ...> <xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="first-name" type="xs:string"/> <xs:element name="last-name" type="xs:string"/> <xs:element name="quadrant" type="myns:compass-direction"/> </xs:sequence> </xs:complexType>

Can't insert PGpoint type with JPA

旧街凉风 提交于 2019-12-07 15:50:27
问题 I am trying to persist one of my JPA/EclipseLink models, one attribute location of type org.postgresql.geometric.PGpoint is not inserting correctly. My model looks something like this: @Entity @NamedQuery(name="Entity.findAll", query="SELECT * FROM Entity e") public class Entity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Column(name="name") private String name; @Column(name="location") private PGpoint location; @Column(name="date") private Timestamp date;

It is possible to override properties in a persistence.xml that is located in a jar dependency

烈酒焚心 提交于 2019-12-07 13:34:05
问题 I have a java-ee web application that uses a persistence unit that is packaged as a jar dependency (Entity classes, EJB repositories, persistence.xml). In order to get some acceptance tests running for the web application i need to override a property in the packaged persistence.xml. To be specific i need to disable the by default active eclipselink shared object cache by setting the following property. <property name="eclipselink.cache.shared.default" value="false"/> This is necessary

Hibernate Serialization Exception in GWT but Eclipselink not

最后都变了- 提交于 2019-12-07 12:12:49
问题 I am using eclipselink JPA implementation (Entity) with GWT 2.0 framework on presentation layer. Everything is working properly. But when i change my JPA implementation to Hibernate, I get Serialization/Deserialization Exception on GWT Layer when I pass entity beans but It is okay on eclipselink JPA. Whats really happens? Hibernate is an implementation of JPA and eclipselink too, why those act differently? What should I do for solving this exception on Hibernate? using Hibernate4gwt? Which

EclipseLink - non Entity as target entity in the relationship attribute

偶尔善良 提交于 2019-12-07 09:25:20
问题 I am using the Netbeans IDE 8.0.2 and eclipselink 2.5.2. This occurring exception below when opening a connection, the problem is that this does not happen every time. The entity described in exception "Departmento" exactly follows the pattern of the other classes being that our system already contain approximately 500 entity classes and only in the new classes are taking place this exception. This entity was generated by that option "Entity Classes from Database" of Netbeans and added to the

ResultSet.next very slow only when query contains FIRST_ROWS or ROWNUM restriction

会有一股神秘感。 提交于 2019-12-07 08:49:27
问题 I execute a native query using entityManager.createNativeQuery(sqlQuery); query.setMaxResults(maxResults); List<Object[]> resultList = query.getResultList(); To speed up the query, I thought to include the FIRST_ROWS(n) hint or limiting using WHERE ROWNUM > n . Using instrumentation, I see that indeed OraclePreparedStatement.executeQuery is faster, but a lot more time is spent in EJBQueryImpl.getResultList leading to an overall very poor performance. Looking more into detail, I see that every

MOXy's @XmlCDATA seems to have no affect

与世无争的帅哥 提交于 2019-12-07 08:38:32
问题 I would like to have the following returned to the browser (view source) <content> <![CDATA[Please show this inside a unescaped CDATA tag]]> </content> But I acutally get <content> Please show this inside a unescaped CDATA tag </content> If, I change the value of content to be &lt ;![CDATA[Please show this inside a unescaped CDATA tag]]&gt ; , the less than and the greater than for the tag are escaped. Wondering how to achieve what I wanted???? Here is my code import javax.ws.rs.GET; import