Hi.
I have a pretty simple sql I need to perform.
I have a ProcessUser, Role and a ProcessUserRole table. A straight forward many-to-many
I want to select all ProcessUser's that does also have a Role of admin.
However my jpa sql fails because my user also has role officer, so it is retrieved in the list.
Here is the sql:
entityMana...
I want to have two EntityManagerFactories (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in this case), with each of them having their own data source and own set of persistent objects.
So somehow I need to be able to scope entities to a particular entity manager factory. I would prefer not to have to hard code the ...
Can somebody tell me the intrinsic reasons why in the JPA 1.0 EntityManager when retrieving an Object via find, you have to deal with null if not found, but when using the Query interface via createQuery getResultList throws a NoResultException when not found.
Maybe i am missing something but I feel its very inconsistent for a Language,...
Hi, new to Spring and here @stackoverflow
I'm building an stand-alone Inventory & Sales tracking app (Apache Pivot/Spring/JPA/Hibernate/MySQL) for a distributor business.
So far I think everything is CRUD, so I plan to have a base class with everything @Transactional.
Then I got a problem with my save generic method. Does persist and ...
In this JPA example there is a code:
@OneToOne(cascade=CascadeType.ALL)
private Deity mother;
@OneToOne(cascade=CascadeType.ALL)
private Deity father;
@OneToMany(cascade=CascadeType.ALL)
private Set<Deity> children;
Why relation with father and mother is implemented by @OneToOne annotation and not in @ManyToOne relation? If Child an...
We have strictly defined which relationships are CascadeType.MERGE in our app. This plays into our version checking (optimistic locking). So, our CascadeType definitions sometimes have MERGE and sometimes not. This is all great for our OLTP application. However, we also have a requirement to load in data (fine to do it batch offline)...
Hi. I seem to get a ConcurrentModificationException when I have a CollectionOfElements inside an Embedabble.
If would like to have it like that, however If I change Route from Embedabble's to Entity than everything works fine. I have even tried adding @Version, but that doesn't seem to work.
Here are a snippet of my classes.
Kart.java:...
NOTE: I have changed the details provided due to comments provided. The new technical details are actually code that I am trying to run currently.
I have a weird problem going on currently with one of my OneToMany / ManyToOne bidirectional relationships.
In the parent table I have a long which is the identifier and the child also h...
I have a struts 2 application and a toplink persistence provider running on tomcat 6.0.20 and a MySql 5.1.38 server on a GNU/Linux machine. After committing the data the when i go to retrieve it the data it has disappeared from the database.
I do a em.commit() and em.flush() after my queries have executed. How do they disappear? I am u...
I have a two classes, Service and Customer, with a many-to-one association from Service to Customer. I want to delete a Customer and any Service that references it. I'm using JPA as the ORM (with Hibernate underneath) attached to a PostgreSQL db.
It'd be great if I could define the association in such a way that deleting the Customer wo...
I have come across a situation (which I think is weird but is possibly quite normal) where I use the EntityManager.getReference(LObj.getClass(), LObj.getId()) to get a database entity and then pass the returned object to be persisted in another table.
So basically the flow was like this:
class TFacade{
createT(FObj, AObj) {
T T...
Is there any sort of tool available which allows one to execute JPQL queries against a database "directly"? I would like to type JPQL queries directly into a window and execute them.
Of course it would probably require me to do quite a bit of configuration so that it would be aware of my JPA entities, etc., but I guess it could be done...
I am using Eclipse Galileo and I wanted to deploy a simple application, using JPA, GlassFish 2.1 and MySQL 5. Unfortunately, I could not find any tutorials for GlassFish 2.1 (just for 3.0, but I cannot use it).
I created a JPA project, added a MySQL5 connection and generated an Entity from the database.
The generate JPA class is:
pac...
What is the best way to fill tables create with jpa at application startup/shutdown of application ?
like but with data manipulation language instead data definition language.
i'm using HibernatePersistence as persistence provider.
...
I am attempting to get EclipseLink JPA working inside the Spring dm Server OSGi environment.
Relevant frameworks and libraries downloaded from the Spring Enterprise Bundle Repository include:
dm Server 1.0.2.SR02
AspectJ Runtime 1.6.3
AspectJ Weaver 1.6.3
Spring Framework 2.5.6.A
Eclipse Persistence 1.1.0
Javax Persistence API 1.99.0...
Hi,
I'm learning Seam and JPA/Hibernate and while I could find some examples on how to build a DAO class with Hibernate I'm a bit confused on how to do the same thing with Seam (or even if that is at all necessary).
I do know that seam manages the transactions using its conversations so I don't (?) have to worry about committing / roll...
Hello,
We have a project that uses JPA/Hibernate on the server side, the mapped entity classes are in their own Library-Project and use Annotations to be mapped to the database. I want to use these classes in an Android-Project - is there any way to ignore the annotations within Android, to use these classes as standard POJOs?
...
I have a JComboBox binded to an observable list (result of a jpa query) in a java desktop application. It gets all the values from that list and displays them correctly, but I'm not able to select any particular value from the dropdown: that is, when I click on the widget the list of options gets displayed correctly, when I click on an i...
Hi. i have a swing desktop application that use a entitymanagerfactory, but when this application is executed many times at the same time, the diferents entity managers have old data that was modified by others and this changes will not visible until the next entitymanagerfactory... how can i sync in anytime the entitymanager with the da...
Can anyone point me to an example on how to use CURRENT_DATE in a JPA query?
CURRENT_DATE is specified in JPA but I haven't been able to make it work. I always get the unexpected token [CURRENT_DATE] exception. Since is specified in JPA all providers should comply with it right?
I'm using EclipseLink 2.0 BTW.
...