datanucleus

How to query for an interface and filter the resultset with JDOQL?

Hi, I have an interface @PersistenceCapable public interface MyInterface { public abstract String getName(); public abstract void setName(String name); } The persistence layer uses JDO. The JDO implementation is DataNucleus. Now I want to query for any instances of that interface with JDOQL. Query query = getPersistence...

JPA Query toString

Hello SO, I have a JPA Query I am executing on the Google App-Engine datastore. I am building the query using parameters. After all parameters have been inputted, I wish to view the Query String. That is, I wish to view the actual query being executed by the datastore. Is that even possible? It would really help me in debugging. To SOL...

How to LOG with DataNucleus 2.x inside Eclipse

I have DN 2.x on Eclipse RCP (currently Helios). I'm having trouble Turning the DN LOG on. I use log4j.properties, where i define all the DataNucleus Categories LOG levels. It LOGS fine with the "external" enhancer (i just pass the argument on the "VM Arguments" of the RUN configurations -Dlog4j.configuration=file:"...\log4j.propertie...

Is there a good step-by-step tutorial for using datanucleus and maven?

I have a basic java-maven-wicket project and need a persistence layer. I want to start with something fairly simple and low maintenance so I can concentrate on the business logic. I've been using db4o directly but have been having some issues and would like to move to using datanucleus as it supports both db4o or regular rdbms. Unfortuna...

GAE JPA DataNucleus One-to-Many object creation

Hello all, Let's say an Owner has a collection of Watch(es). I am trying to create Watches and add the newly created Watches to an existing Owner's collection of watches (an arraylist). My method is as follows: public void add(String ownerName, String watchName) { Owner o = new OwnerDAO().retrieve(ownerName); //retrieves owner o...

Many-to-one unidirectional GAE JDO relationship amongst Entities

I have two classes, Truck and Tweeter, where every Truck must have a Tweeter and every Tweeter can have any number of Trucks associated with it. All I want is to be able to store a reference of the associated Tweeter in all my Truck objects so I can access it without having to explicitly look it up. Given a Tweeter, I don't need to kno...

Problem persisting collection of interfaces in JDO/Datanucleus. "unable to assign an object of type.."

I am getting below error whilst trying to persist an object that has a collection of interfaces which I want to hold a couple of different types of objects. Seems to be happening almost randomly. Sometimes after restarting it works ok ( I might be doing something wrong though). class CommentList { @Persistent @Join ArrayList<IComment> ...

java.lang.IllegalStateException, "Primary key for object of type Parent is null" except I can print it and its NOT null

I cant imagine any more methods to solve my problem. Here's a thread I made yesterday that describes the parent and child class in detail: http://stackoverflow.com/questions/3800450/many-to-one-unidirectional-gae-jdo-relationship-amongst-entities I'm trying to add a Truck and persist it, but the persistence manager insists that the p...

Why does JDOQL query using "matches" semantics only work with a literal?

I'm trying to construct a JDOQL query (using datanucleus) that will search for matches of a parent class based on criteria in an owned one-to-many child class. The query looks like this: Query lQ = lPm.newQuery("select from "+Module.class.getName()+ " where moduleMappings.contains(m)" + " && showNameParam.ma...

Eclipse & Datanucleus - Help implementing PoolManager (BoneCP,Proxool,C3P0 or DBCP)

Datanucleus supports some pool manager options: http://www.datanucleus.org/products/accessplatform_2_2/rdbms/connection_pooling.html DBCP plugin C3P0 plugin Proxool plugin And recently BoneCP plugin I've tried EVERYONE of them, with NO success, because of OSGI (i'm under ECLIPSE RCP) The closest i've been to succeed was with DBCP...

SQL Server 2005 and Datanucleus problem (ntext query)

Started getting errors with SQL Server 2005 This is the first time i've tested our app with Datanucleus 2.x (last test was made with DN 1.x) I use Eclipse RCP. Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The ntext data type cannot be selected as DISTINCT because it is not comparable. at com.microsoft.sqlserver.jdbc.SQL...

H2 datastore EXTREMELY slow!!!

I just tested the H2 datastore (with Datanucleus 2.x) The performance is VERY slow. 1/3 of Postgres and 1/10 of MySQL (aprox.) I was very pleased by the "specs" but i cannot see them in "real usage". http://www.h2database.com/html/performance.html Is there any performance tuning that i might be missing? NOTE: even when accessing "our...

Using ORDER By with DataNucleus Rest API and GAE Datastore

I'm successfully pulling back my objects however, I would like for them to already be sorted by a field in the object. I have this working: new Ajax.Request("/dn/com.emooney.meeting.beans.Meeting?groupName=='"+name+"'" But I want to do something like this: new Ajax.Request("/dn/com.emooney.meeting.beans.Meeting?groupName=='"+name+"...

datanucleus enhancer & javaw: "the parameter is incorrect"

I'm on windows XP using eclipse and the datanucleus enhancer for a gwt + gae app. When I run the enhancer, I get an error: Error Thu Oct 21 16:33:57 CDT 2010 Cannot run program "C:\Program Files\Java\jdk1.6.0_18\bin\javaw.exe" (in directory "C:\ag\dev"): CreateProcess error=87, The parameter is incorrect java.io.IOException: Cannot r...

How do I set a the compiler option 'processor' in Eclipse?

I'm trying to follow these instructions to configure the DataNucleus enhancer: If using Eclipse you need to edit your project properties. Go to Java Compiler -> Annotation Processing and enable the project specific settings and enable annotation processing. Then go to Java Compiler -> Annotation Processing -> Factory Path...

With JDO, is it possible to query for all objects that implement a particular interface?

I tried using the following query: Query q = getPersistenceManager().newQuery( getPersistenceManager().getExtent(ICommentItem.class, false) ); but got: org.datanucleus.exceptions.NoPersistenceInformationException: The class "com.sampleapp.data.dataobjects.ICommentItem" is required to be persistable yet no Meta -Data/Annotations c...

ClassCastException in DataNucleus DAO object when persisting/retreiving an Object using JDO

I've created a simple webapp using Spring & Jetty, and am creating a hello world JDO test using DataNucleus & DB4O. I can persist a class no problem, but when I go to query for the class I get a ClassCastException, can't cast a.b.c.MyClass to a.b.c.MyClass. When I examine the classloader of the original object I created, it's [WebAppCl...

JDO not retrieving/persisting a collection

I have the following data model class defined: @PersistenceCapable public class TestSerializableModelObj { @Persistent(serialized="true", defaultFetchGroup="true") private MyPOJO myField; @Persistent(serialized="true", defaultFetchGroup="true") private Collection<MyPOJO> myCollection; // getter/setters } MyPOJO i...

App Engine datastore get number of childs from multiple parents

I'm using the datastore of the Google App Engine (DataNucleus). I have two classes, one Chat and one Rating. A chat can be rated more then ones so I created an one-many relationship by adding a list to the Chat class. Now I want to know the number of unrated chats, so I did the following: int numberOfChatsInStock = 0; for(Chat chat : ...

JDO: Is the PersistenceManager a singleton?

Just the basics: I'm using DataNucleus backed with an embedded DB4O database. If I do this simple test: PersistenceManager pm1 = persistenceManagerFactory.getPersistenceManager(); PersistenceManager pm2 = persistenceManagerFactory.getPersistenceManager(); pm1.makePersistent(t1); pm2.makePersistent(t2); I get a file l...