jdo

Issues with migratiing from DataNucleus/JDO version v1 to v2

这一生的挚爱 提交于 2019-12-25 01:15:57
问题 I am using App Engine. I'm trying to upgrade from DataNucleus/JDO version v1 to v2. (JDO2.0 to JDO3.0) My code however has following problems under v2 (and works fine in v1) 1/ The result from a query gives a nullPointerException. Query q = pm.newQuery(Company.class, query); List<Company> companies = (List<Company>) q.execute(); // this should return a non-empty list for (Company company: companies) -> NullPointerException 2/ After persisting an object, I get a serialization error : public

Not able to connect to remote Hbase

不打扰是莪最后的温柔 提交于 2019-12-24 12:57:13
问题 i have a Hbase installation in distributed mode. The database is working fine and I am able to connect to the database if my webapp(spring + datanucleus JDO) is deployed on the same machine as the Hbase master. But if I run the same webapp on a different machine I am not able to connect to the HBase server. There are no exceptions at all and the webapp just stalls and after a few minutes times out. My config files are as follows: hbase-site.xml -> <configuration> <property> <name>hbase

Where is class definition for org/datanucleus/store/mapped/scostore/JoinSetStore

纵然是瞬间 提交于 2019-12-24 12:15:16
问题 I am trying to run Data Nucleus+JDO+google cloud sql. However I get a class not found for org/datanucleus/store/mapped/scostore/JoinSetStore. What Jar contains that? com.google.api.server.spi.SystemService invokeServiceMethod: null java.lang.ExceptionInInitializerError at com.example.e_math.NoteEndpoint.getPersistenceManager(NoteEndpoint.java:162) at com.example.e_math.NoteEndpoint.insertNote(NoteEndpoint.java:96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect

What does “:P” mean in a JDO query

 ̄綄美尐妖づ 提交于 2019-12-22 10:48:35
问题 I am using JDO on google app engine. Each 'Employee' has a 'key'. I have a set of keys and wanted to retrieve all Employees whose key belongs to this set. So I implemented it using the 'contains()' filter as specified here. The code works fine and looks like this - List<Key> keys = getLookupKeys(....) ..//Get keys from somewhere. Query query = pm.newQuery(Employee.class,":p.contains(key)"); //What is ":P" here? List<Employee> employees = (List<Employee>) q.execute(keys); //This correctly

JDO for Google App Engine: escaping quotes

半世苍凉 提交于 2019-12-22 07:03:59
问题 How do I escape parameters of queries in JDO (Google App Engine)? For example, how do I make the next snippet safe, if the variable name may contain unsafe chars as single quotes (') PersistenceManager pm = ...; String query = "select from Person where name='"+name+"'"; List<Shortened> shortened = (List<Shortened>) pm.newQuery(query).execute(); 回答1: Use query parameters instead, it's a much safer than including the values in the query itself. Here is an example from the GAE documentation:

Why put a DAO layer over a persistence layer (like JDO or Hibernate)

浪子不回头ぞ 提交于 2019-12-20 09:05:11
问题 Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But the earliest examples of Java DAOs interacted directly with relational databases -- they were, in essence, doing object-relational mapping (ORM). Nowadays, I see DAOs on top of mature ORM frameworks like JDO and Hibernate, and I wonder if that is really a good idea. I am developing a web service using JDO as the persistence layer, and am considering whether or not to introduce DAOs. I foresee a problem when

How do you properly add/manipulate thousands of children in an entity group?

牧云@^-^@ 提交于 2019-12-18 18:22:54
问题 This further to my previous question on handling large numbers of objects in BigTables/JDO. Assuming a TransactionAccount could end up with as many as 10,000 objects in its transactions list, how does this work with Goodle app engine? How do you add objects to such a large list without the whole list being loaded into memory? (The assumption is that 10,000 objects shouldn't be loaded into memory?) I am not trying to ask you how to do my homework, I just have no idea where to start to solve

How do you properly add/manipulate thousands of children in an entity group?

社会主义新天地 提交于 2019-12-18 18:22:45
问题 This further to my previous question on handling large numbers of objects in BigTables/JDO. Assuming a TransactionAccount could end up with as many as 10,000 objects in its transactions list, how does this work with Goodle app engine? How do you add objects to such a large list without the whole list being loaded into memory? (The assumption is that 10,000 objects shouldn't be loaded into memory?) I am not trying to ask you how to do my homework, I just have no idea where to start to solve

How do you properly add/manipulate thousands of children in an entity group?

耗尽温柔 提交于 2019-12-18 18:22:11
问题 This further to my previous question on handling large numbers of objects in BigTables/JDO. Assuming a TransactionAccount could end up with as many as 10,000 objects in its transactions list, how does this work with Goodle app engine? How do you add objects to such a large list without the whole list being loaded into memory? (The assumption is that 10,000 objects shouldn't be loaded into memory?) I am not trying to ask you how to do my homework, I just have no idea where to start to solve

What's the easiest way to persist java objects?

五迷三道 提交于 2019-12-17 18:47:11
问题 Right now I have java program whose classes are currently POJOs and stored in volatile memory. These need to be persisted. As I understand it two popular choices are JDO and the Java Persistence API. For someone who know little about SQL, Torque, etc, which is the easiest way to add persistence to my program's data? 回答1: The traditional way to serialise to the filesystem is to use Java Serialisation. However you need to implement Serializable everywhere. A simpler solution is to serialise to