eclipselink

ClassCastException with GWT/RequestFactory on WebLogic

◇◆丶佛笑我妖孽 提交于 2019-12-11 03:16:24
问题 I'm setting up a GWT application based on GWT/RequestFactory on client side, and JPA/EclipseLink over WebLogic on server side. However, during development, everytime I change something on the server-side code (it can be an entity, the DAO, or even a comment in a Java file!), I get a ClassCastException between 2 apparently similar classes when I try to use my application, and the only way to get rid of it is to restart my WebLogic server. Even redeploying the application doesn't help. Feb 10,

Explicit delete on JPA relationships

喜你入骨 提交于 2019-12-11 03:14:44
问题 I am a bit confused about managing relationship in JPA. basically I have two entities with a One to Many relationship A configuration can have have a one or many email list associated with it. @Entity public class Config { @OneToMany(mappedBy="owner",cascade=CascadeType.ALL, fetch=FetchType.EAGER) private List<Email> emailReceivers; } @Entity public class Email { @ManyToOne private Config owner; } In an EJB and during update/merge operation wherein I would edit the list of emails associated

Can't get Eclipselink level 2 cache to work

旧城冷巷雨未停 提交于 2019-12-11 03:05:55
问题 I have a minimal web app that you can download here (6Kb): http://www.mediafire.com/?6vo1tc141t65r1g the relevant config is : -eclipselink 2.3.2 -server is tomee 1.0 (but glassfish 3.1 is the same) When I hit the page and press F5 to refresh repeatedly : http://localhost:8080/testCache/jsf/test.xhtml I see several lines like that in the console [EL Fine]: 2012-08-29 19:01:30.821--ServerSession(32981564)--Connection(27242067)--Thread(Thread[http-bio-8080-exec-12,5,main])--SELECT id, tasktype

JAXB-Eclipselink: Mapping abstract “getter” to XML

╄→尐↘猪︶ㄣ 提交于 2019-12-11 02:58:48
问题 I am using the EclipseLink implementation (2.3) of JAXB to map POJOs to XML and encountering a problem with following usecase: public abstract class A { public abstract Set<X> getX(); // There is no setter } public class B extends A { // Set via constructor private Set<X> x; @Override public Set<X> getX(); } I am defining the mapping itself completely in an external bindings-file, i set class A to be transient like so: <java-type name="foo.A" xml-transient="true"/> and for class B: <java-type

How to define the EclipseLink annotation for the following?

半腔热情 提交于 2019-12-11 02:34:13
问题 I'm relativly new to the world of EclipseLink, I've been reading through the documentation, however I'm having a real problem trying to represent the following table. PTY_NO | REF_OBG 6544 45663 6544 1234 6544 97543 6544 1123 6544 77897 Ideally I'd like to represent the above data as follows. @Entity @Table(name="FCS_ISSR_OBG") public class fcs_issr_obg implements Serializable { @Id @Column(name="PTY_NO") private long pty_no; @Column(name="REF_OBG") private List<long> ref_obg; ... As once I

autoincrement id is not reflecting in composite key using JPA

血红的双手。 提交于 2019-12-11 02:22:30
问题 I have a below mapping @Entity @Table(name = "auctions") public class Auction{ . . @OneToMany(cascade = CascadeType.ALL, mappedBy = "auction") private List<AuctionParamValue> auctionParamValueList; . . } @Entity @Table(name = "auction_param_values") public class AuctionParamValue { @EmbeddedId protected AuctionParamValuePK auctionParamValuePK; @JoinColumn(name = "auction_param_id", referencedColumnName = "auction_param_id",updatable=false,insertable=false) @ManyToOne @MapsId("auctionParamId")

Dynamic JAXB exceptions

你。 提交于 2019-12-11 02:11:51
问题 I am using eclipse link(v2.5.0) Dynamic JAXB to convert XML to JSON and viceversa using a multiple schemas. emp.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:emp="Employee:2:0" targetNamespace="Employee:2:0" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="2.0"> <xsd:element name="searchManager" type="emp:SearchManager" /> <xsd:complexType name="SearchManager"> <xsd:sequence> <xsd:element name="CompanyName

How to handle Oracle Store Procedure call with Oracle Types as input or output using EclipseLink

点点圈 提交于 2019-12-11 02:08:08
问题 I doing a Proof Of Concept to figure out how efficient to call a store procedure using EclipseLink. I was able to call oracle store procedure using EclispeLink with Scalar/primitive data types (link Integer, varchar etc). I wanted to understand how can I handle Oracle Store procedure from EclipseLink with collection(Oracle Types/User defined types) as input or output parameters. I would really appreciate if some one help me understand this with an example. Thanks MAK Here is the example which

Java Eclipselink on TomEE gives “Missing required persistence.xml”

六眼飞鱼酱① 提交于 2019-12-11 01:49:22
问题 I'm trying to setup Eclipselink on TomEE but i ran into the problem that i get an error about missing the persistence.xml. But the persistence.xml is present at ProjectPath/META-INF/persistence.xml. I'm running a Maven project on IntelliJ with Jersey and Eclipselink. This is my persistence.xml: <persistence-unit name="DietMakerPostgres"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>database.DietEntity</class> <class>database.DietSavedEntity</class> <class

JPQL Native Query using SUM and COUNT

ⅰ亾dé卋堺 提交于 2019-12-11 01:25:12
问题 I am trying to run the following code: public BigDecimal valuate(String searchTerms, String categoryPath) { Query query = em.createNativeQuery("SELECT SUM(maxBidAmount) / COUNT(maxBidAmount) FROM Item WHERE MATCH(title) AGAINST(':searchTerms') AND categoryPath=':categoryPath'", Double.class); query.setParameter("searchTerms", searchTerms); query.setParameter("categoryPath", categoryPath); double value = (double) query.getSingleResult(); return new BigDecimal(value); } When I do so, I get the