eclipselink

JPA2, LEFT JOIN, Criteria API

亡梦爱人 提交于 2019-12-13 04:15:34
问题 I have the following situation SQL that I need to implement into my criteria builder for dynamic query creation. select t1.ticketnr from tbl_ticket t1 left join tbl_tickets_updates t2 on t1.ticketnr = t2.ticketnr where t1.description ilike '%EXAMPLE%' or t2.description ilike '%EXAMPLE%'; In my code I have the following: tbl_ticket = Tickets.class PK = ticketnr tbl_tickets_updates = TicketsUpdates.class and TicketsUpdatesPK.class PK = ticketnr, updatedby, timeofupdate CriteriaBuilder builder =

EntiyManager CreateQuery Hangs

做~自己de王妃 提交于 2019-12-13 03:58:57
问题 I am creating a webapp with EclipseLink for the persistence layer, and I have a DAO that is hanging when I attempt to load an object. The application/code has previously worked when loaded in to other machines/IDEs, but I have just loaded it into Eclipse Indigo on a Windows 7 machine and this error has started occuring (there are no compile errors/warnings in the code etc, and the app builds/starts fine). The DAO method is as follows: public Account loadAccountByUserName(String userName) {

Synchronization error when insertable = false in EclipseLink

倖福魔咒の 提交于 2019-12-13 03:36:46
问题 This my entity @Entity public class Order { ... @OneToMany (fetch = FetchType.LAZY) @JoinColumn(name="order_uuid", insertable = false, updatable = false) private List<Item> items; } When I create new Oder and save it in DB I get: Caused by: java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: com.temp.Item@3cd8c5f. Could anyone explain the reason of this error (I did add insertable = false ) and how to fix

Criteria eclipselink join

那年仲夏 提交于 2019-12-13 02:56:48
问题 I can't understand how do a join in eclipse link with criteria. This my entity: public class A implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id") private Long id; @Column(name = "value") private String value; @OneToMany(mappedBy = "aid") private Collection<B> bCollection; } public class B implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id")

Why is my EclipseLink Query Results Cache NOT working

前提是你 提交于 2019-12-13 02:17:32
问题 I am developing a website on TomEE, and I want to use the EclipseLink Query Results Cache (L2) working, but every time I reload my web page, SELECT query is running (checked via general_log of mysql). My Database entity looks like below: @Entity(name="item") @NamedQueries({ @NamedQuery(name="ItemEntity.getAllList", query="Select distinct itemEntity from mypackage.entity.ItemEntity itemEntity", hints={ @QueryHint(name="eclipselink.query-results-cache", value="true"), @QueryHint(name=

Can't deploy Java EE Application to Wildfly

左心房为你撑大大i 提交于 2019-12-13 01:31:48
问题 im trying to migrate from Glassfish AS to WildFly AS. After I created the JDBC Datasource in Wildfly and changed the persistnce.xml accordingly i get this error on deploy: server.log: 2014-04-10 10:34:26,496 INFO [org.xnio.nio] (MSC service thread 1-6) XNIO NIO Implementation Version 3.2.0.Final 2014-04-10 10:34:26,552 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 2014-04-10

EclipseLink persistence and refresh both association entities

百般思念 提交于 2019-12-13 00:36:00
问题 I'm using EclipseLink in my Java EE project with a PostgreSQL database. I have trouble finding the right annotations for a correct behaviour when I persist/refresh entities which are part of oneToMany/manytoOne associations. For example, I have an entity "Project" which is first created by the users through a UI. Then the users can add "Analysis" into the project they created. Hence, an analysis is part of one project and a project can have several analysis. The persist action works fine (I

Cache Isolation Level Warning on Parent Entity

时光毁灭记忆、已成空白 提交于 2019-12-13 00:16:44
问题 After adding a second persistence unit and changing my application's data sources to XADataSource (MySQL), I'm now getting a confusing warning in the glassfish log about isolation levels on my parent entity: WARN o.e.p.s.f.j.ejb_or_metadata : Parent Entity BaseEntity has an isolation level of: PROTECTED which is more protective then the subclass Contact with isolation: null so the subclass has been set to the isolation level PROTECTED. After some research, I think that this isolation level

Inheritance mapping throwing an exception with MOXy

℡╲_俬逩灬. 提交于 2019-12-12 23:52:49
问题 I followed the second option mentioned in JAXB inheritance in MOXY to map my parent class and child class listed below. MOXy is throwing the below exception and not sure what the issue is Parent class public class UnitedStatesAddressData extends AbstractAddress implements UnitedStatesAddress, Serializable, Cloneable { private String primaryAddress; public String getPrimaryAddress() { return primaryAddress; } public void setPrimaryAddress(final String primaryAddress) { this.primaryAddress =

CriteriaBuilder.isEmpty on an ElementCollection vs. JPQL approach

吃可爱长大的小学妹 提交于 2019-12-12 22:19:54
问题 I'm trying to do a simple query using the JPA2 criteria API on the following class(es): // a lot of imports @Entity public class Thing { enum Type { FIRST, SECOND, THIRD }; @SequenceGenerator(name = "Thing_SeqGen", sequenceName = "Thing_Id_Seq", initialValue = 1000) @Id @GeneratedValue(generator = "Thing_SeqGen") private int id; private String name = "name"; @Enumerated(EnumType.STRING) @ElementCollection(targetClass = Thing.Type.class) @CollectionTable(name = "TYPES", joinColumns = {