eclipselink

EclipseLink Connection Timeout

天大地大妈咪最大 提交于 2019-12-10 17:56:12
问题 This should be an old question, but I searched a lot and found nothing useful. My main problem is that when the connection losts, my Java swing application freezes. There must be a connection timeout so that the application informs the user. I tried this and this but they wasn't helpful. Is this really a weakness in EclipseLink or this is something I can't figure out? Edited: Here is how I connect via EclipseLink: private static javax.persistence.EntityManager em = null; public static javax

JPQL we can't CONCAT(String, Integer) EclipseLink?

笑着哭i 提交于 2019-12-10 17:44:04
问题 In a JPQL query I tried to concatenate a string with a integer, using CONCAT JPQL function, in a select clause, for example: SELECT CONCAT(c.idClient, ' ', c.name) FROM Clients c; But the result is not a readable String. Can we only use String in CONCAT function? Thanks in advance. 回答1: CONCAT is meant for Strings, the result of calling it with a number would most likely depend on your database. You could try converting the id to a char first, you could use the FUNC function in EclipseLink to

JPA/Eclipselink cache life span

谁都会走 提交于 2019-12-10 17:35:12
问题 1.- I'm working Glassfish 2.1 with EcipseLink 2.0.0, so really using JPA 1.0 specification, and I have a stateless EJB that finds entities among other things. As far as i know JPA 1.0 defines a L1 cache that works at Persistence Context level (transaction level for stateless EJBs) but I can't figure out why the next code prints "Not same instance" if it's within the same transaction. @Stateless @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public class EntityServiceBean

Can I use JPA 2.0 with Google App Engine?

狂风中的少年 提交于 2019-12-10 17:34:53
问题 Can I use JPA 2.0(e.g EclipseLink) with Google App Engine? 回答1: The DataNucleus plugin to the Google AppEngine supports both the JDO and JPA API to access Google AppEngine Datastore infrastructure. Currently this implementation seems to support JPA1 only. 回答2: No, you can't use any implementation on GAE and they only support JPA 1.0. Quoting Using JPA with App Engine: The App Engine Java SDK includes an implementation of JPA 1.0 for the App Engine datastore. The implementation is based on

How to solve CompletionFailure when using EclipseLink Modelgen processor and Spring Security?

跟風遠走 提交于 2019-12-10 17:27:23
问题 I am trying to use Spring Security in a project where I use eclipselink as the modelgen processor to generate the static meta model. When I try to do this I get strange compilation errors like: > java.lang.RuntimeException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.springframework.security.ldap.DefaultSpringSecurityContextSource not found even though I do not use LDAP. If I add the jars I get other errors like missing sl4j, missing openid, etc etc. If I exchange

Manager Bean do not returns when the project is online

泪湿孤枕 提交于 2019-12-10 17:10:11
问题 I have a JSF project working with JPA, I do this : retrive some data from mysql database then plot the data in a chart. Locally works pretty fine, as you can see here: So I deploy the project in my GlassFish 3 Open Source, which is running in a EC2 instance, then I try to make the same operation again but it seems the ManagedBean do not returns to the page correctly: This is my ManageBean : @ManagedBean(name="reportc") @SessionScoped public class ReportControl implements Serializable {

QueryDSL JPA syntax error with contains on Set?

别说谁变了你拦得住时间么 提交于 2019-12-10 16:43:59
问题 I have a JPA entity bean similar to the following: @Entity class License { @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name = "LicenseTags") Set<Tag> tags; // Skipped remaining members } Tag itself is also an Entity with an id and a name. Now I want to query for licenses that have certain tags attached to them. When I try the following query Set<Tag> tags = ...; final QLicense license = QLicense.license; JPAQuery q = new JPAQuery(entityManager).from(license); for (Tag tag : tags) { q

How can I store and display dates in the timezone as they were originally given?

懵懂的女人 提交于 2019-12-10 16:35:45
问题 I have a server that is being fed data from clients in different timezones. The data feed contains people, their date of birth and other dates of events. For our purposes, it would be convenient if we could just store the dates as their given to us. For example, if the client is in California and it tells us the person's date of birth is May 31st, we'd like to store it in the database as May 31st 1999, pacific time. This way, no matter what timezone you're in, you can see that the person was

Using eclipselink in Java code run from MATLAB

≡放荡痞女 提交于 2019-12-10 15:34:47
问题 I am trying to provide an interface that I can call from MATLAB to access the contents of a database. I already have an existing Java interface that uses eclipselink to connect to the database and I would like to re-use it. I wrote a class to provide this and it works properly when I call it straight from Java, but when I try to call it from MATLAB I get the following exception: javax.persistence.PersistenceException: No Perisistence provider for EntityManager named DatabaseConnection Usually

EclipseLink merge unexpected cascade

泪湿孤枕 提交于 2019-12-10 14:31:07
问题 I have two entity classes user and device. User entity: public class User { private Long userId; @OneToMany( mappedBy = "userId", fetch = FetchType.LAZY) private Collection<Device> deviceCollection; and device entity: public class Device implements Serializable { @JoinColumn(name = "user_id", referencedColumnName = "user_id") @ManyToOne(optional = false, fetch = FetchType.LAZY) private User userId; When I merge a previously detached device entity into the entity manager after the parent user