Here is simple example I've created after reading several topics about jpa bulk inserts, I have 2 persistent objects User, and Site. One user could have many site, so we have one to many relations here. Suppose I want to create user and create/link several sites to user account. Here is how code looks like, considering my willing to use ...
Hi, sorry for my english, I speak spanish.
I recently migrate an application from ejb 2.x to ejb3 (approx. 300 entities), Im using WebSphere 7.0.0.9.
After 10 hours of work, the system crash with an OutOfMemoryError.
Analyzing the coredump, I see a lot of instance of the org.apache.openjpa.jdbc.meta.ClassMapping class (please see the a...
Given a lookup table:
| ID | TYPE | CODE | DESCRIPTION |
| 1 | ORDER_STATUS | PENDING | PENDING DISPOSITION |
| 2 | ORDER_STATUS | OPEN | AWAITING DISPOSITION |
| 3 | OTHER_STATUS | OPEN | USED BY OTHER ENTITY |
If I have an entity:
@MappedSuperclass @Table(name="LOOKUP")
@Inheritance(strategy=In...
Hi!
I'm having trouble handling IDs of my databse tables using OpenJPA and HSQLdb. I created an Abstract class where I handle annotations and stuff to remap into the DB:
// Property accessors
@Id
@Column(name = "IDTESTOBJEKT", unique = true, nullable = false)
public Integer getIdtestobjekt() {
return this.idtestobje...
Hi!
I'm (still) having loads of issues with HSQLdb & OpenJPA.
Exception in thread "main" <openjpa-1.2.0-r422266:683325 fatal store error> org.apache.openjpa.persistence.RollbackException: user lacks privilege or object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE FROM PUBLIC.OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501,...
Below is my test code:
package jee.jpa2;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.Query;
import org.testng.annotations.BeforeClass;
import org.testng.annotatio...
Hi all,
my mysql db has character encoding utf8. In QueryBrowser i can see special characters are correct. In appplication using openjpa i can see the same values also correct.
But when I persist object into DB, I have correct values in application but incorrect in DB!
When I restart application that special characters in application ar...
I'm trying to find information on what triggers a data cache cleardown in kodo / openjpa.
I'm guessing there is a high watermark - at which point the cache will clear down data. Does it just remove a single item once you hit your cache size limit, or a whole load of stuff? Or maybe there is no clear down, and you simply get an error w...
I'm looking for an entity detection in OpenJPA. That I don't need to declare all entities in the persistence.xml.
Edit: I'm sorry, I forgot to say that I develop a java se app.
...
Hi, I have a problem
Tables
sales_2009
sales_2008
sales_2007
And only one class (sales), How change the table at runtime?
...
Is there any jpa 1.0 fluent api/interface for query building? I'm using openjpa 1.x, so I'm stuck with JPA1.
I found QueryByProxy, but its maven repo is not working properly.
...
Hi all.
I'm building an application using OpenJPA 2.0.0, Jersey 1.3, and JUnit 4.8.1.
I've set it up so I have two different persistence units defined in my persistence.xml: "default" and "unittest." Default is set up to connect to an Oracle instance, while unittest is set up to connect to a local H2DB embedded database file. I do th...
I'm trying to configure ehcache with openjpa. I get the following error:
org.apache.openjpa.lib.util.ParseException:
Instantiation of plugin "DataCacheManager" with value "ehcache" caused an error
"java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: ehcache".
The alias or class name may have been misspelled, or the ...
I'm new to EJB 3 and the JPA.
I've created a datasource in the appserver which is jdbc/AppDataSource. The default persistence provider is left as com.ibm.websphere.persistence.PersistenceProviderImpl.
And I left the default jta data source JNDI name as AppDataSource itself.
I'm actually confused regarding JTA and non-JTA. What different...
Hi
I m using JPQL to retrieve data. I can get data using the statement
List persons = null;
persons = em.createQuery("select p.albumName from PhotoAlbum p , Roleuser r
where r = p.userId and r.userID = 1");
Now i can get the album names using this...
int i=0;
for (i=0;i<persons.size(); i++)
{
System.out.println("Testing n "...
I am using JPA 2 for an enterprise application, and my DBA's just hit me with a twist.
They want me to use the group's centralized object ID generator for all my tables. This means rather than using table values or a sequence table, I will need to call a web service to get a batch of ~50 ids.
Then, as I persist any new object, I would...
Hi
I m using JPA to insert a row
My update code as in here
Now i m inserting a row using this code
public void get_image (String id)
{
Object l = null;
try
{
em = this.getEm();
EntityTransaction entr = em.getTransaction();
entr.begin();
newa.Options o = new newa.Options();
newa....
Hello guys,
I have a small problem here and hope that someone can help me out.
I wanna do a mapping from Object to Integer. The Object is marked as Fetchtype.Lazy.
When I do the mapping I get the following error message:
11:31:46,569 ERROR MappingProcessor:253 - Field mapping error -->
MapId: null
Type: null
Source parent clas...
I have a problem with OpenJPA
I try to read all rows from a table but the primary key has always a same value(value = 0)!?!?!?
for (Object o : em.createQuery("select x from AnnouncementsEntry x")
.getResultList()) {
//alway returns "0" in every row
long id = ((AnnouncementsEntry) o).getEntryI...
Update 3:
Addes following code to the pom so openjpa could find the persistence.xml file. Got some query errors left but I finally got openjpa to work :).
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
Update2: Set up maven p...