Все вопросы: [jdo]

45 вопросов

похожие теги: castor-jdo
1
голосов
2ответов
1425 просмотров

Ошибка при сохранении изображения в Google App Engine / Java

Я пытаюсь создать следующую сущность JDO в GAE / J (я использую Gilead ). package test.domains; import java.io.Serializable; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annota...

3
голосов
3ответов
2231 просмотров

Удалить объект по ключу, не извлекая его сначала в движке приложения (с использованием JDO)

Есть ли способ удалить объект, не получая его предварительно из хранилища данных?Я предполагаю, что у меня уже есть ключ или идентификатор объекта. Я думаю о чем-то вроде deleteObjectById, который был бы аналогом getObjectById на PersistenceManager. Самое близкое, что я могу придумать, - это ...

1
голосов
2ответов
153 просмотров

Удаление из набора в Google App Engine не сохраняется

Я вижу аналогичный вопрос в Проблемы при сохранении предварительно сохраненного объекта в Google App Engine (Java) , и действительно, я не вызывал close () в моем диспетчере сохраняемости.Однако сейчас я вызываю close, но обновление моего объекта не сохраняется.В частности, я хочу удалить элеме...

0
голосов
3ответов
1991 просмотров

GWT + JDO + ArrayList

Я получаю Null ArrayList в разрабатываемой мной программе.В целях тестирования я создал этот действительно небольшой пример, в котором все еще есть та же проблема.Я уже пробовал использовать другие первичные ключи, но проблема не устранена. Есть идеи или предложения? Класс из 1 сотрудника...

0
голосов
1ответов
1013 просмотров

JDO, GAE: загрузка группы объектов по дочернему ключу

У меня есть отношения "один ко многим" между двумя объектами: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class AccessInfo { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private com.google.appengine.api.datastore.Key keyInternal; ...

10
голосов
4ответов
8627 просмотров

Google App Engine, JDO и equals / hashCode

У меня есть приложение в Google App Engine, которое работает нормально. Я понял, что один из моих JDO-расширенных объектов, который я забыл реализовать, равно и hashCode (мне нужно использовать объект в наборе). Так я и сделал. Я не делал ничего особенного в этих реализациях, фактически я просто...

1
голосов
1ответов
429 просмотров

JDO: referencing a collection of entities "owned" by another class

I have a RecipeJDO that contains a List<IngredientJDO>. RecipeJDO "owns" the ingredients. This has been working well for me for several weeks. Now I'd like to introduce a new class "GroceryListJDO", that references the ingredients owned by various recipes. When I try to persist a new ...

3
голосов
2ответов
2374 просмотров

Loading a collection of Enums with Google app engine datastore

I am using the Goole app engine datastore with Java and trying to load an Object with a List of Enums. Every time I load the object the List is null. The object is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class ObjectToSave { @PrimaryKey @Persistent(valueStrat...

1
голосов
2ответов
1131 просмотров

One-to-Many relationship. Select objects from datastore

I've omitted some code(package declarations, imports, other fields) for shortness. I have here simple One-to-Many relation. It worked fine till this moment. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class Restaurant implements Serializable { @PrimaryKey @...

5
голосов
1ответов
763 просмотров

JDO for Google App Engine: escaping quotes

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> sh...

5
голосов
2ответов
3475 просмотров

full-text search using Google App Engine and JDO?

I'm using Google App Engine (Java) with JDO. How can I do the JDO equivalent of select * from table where field like '%foo%' The only recommendation I have seen so far is to use Lucene. I'm kind of surprised that something this basic is not possible on out-of-the-box GAE.

2
голосов
3ответов
2149 просмотров

updating "nested" objects with JDO on Google App Engine

I'm having trouble figuring out the proper way to update "nested" data using Google App Engine and JDO. I have a RecipeJDO and an IngredientJDO. I want to be able to completely replace the ingredients in a given recipe instance with a new list of ingredients. Then, when that recipe is (re)pers...

0
голосов
2ответов
2086 просмотров

Java Google App Engine Datastore: 'IN' operator available on JDO query filters, as with Python?

This page describes an 'IN' operator that can be used in GAE Datastore to compare a field against a list of possible matches, not just a single value: However this is for Python. In Java (App Engine 1.2.5), trying query.setFilter("someField IN param"); on my javax.jdo.query fires a JDOUserEx...

2
голосов
1ответов
1278 просмотров

duplicate jdoconfig.xml on classpath during unit tests in Intellij IDEA (9.x pre-release)

As described here, IDEA is adding the jdoconfig.xml to the class path twice during unit test runs. Can anyone suggest a work-around for this? /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java -Dgwt.args=-gen /Users/jgc/Library/Caches/IntelliJIDEA9M1/gwt/recipes.recipe...

81
голосов
12ответов
27975 просмотров

JDO vs JPA for Java on Google App Engine

I want to develop my project on Google App Engine with Struts2. For the database I have two options JPA and JDO. Will you guys please suggest me on it? Both are new for me and I need to learn them. So I will be focused on one after your replies. Thanks.

2
голосов
1ответов
2449 просмотров

updating an object with JDO and GAE

So, I'm creating a small web app using Wicket that will run on the google app engine. I'm using JDO, and so far have no problems persisting data (inserts) or querying data those same data objects. Maybe I'm missing some basic thing, I'm trying to take one of those persisted objects, change two ...

32
голосов
10ответов
16739 просмотров

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

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 H...

2
голосов
1ответов
365 просмотров

Google App Engine / JDO : store computed values

Since I cannot do JOIN queries against the App Engine Datastore, I would like to denormalize my entity objects a little to include computed values, in effect creating something like a function-based index. @Persistent Employee manager; @Persistent // de-normalized stored join value Integer...

4
голосов
2ответов
2865 просмотров

Many to many relationship in java google ap engine

how would i go about creating a many-many relationship among data objects in google app engine (using jdo) The app engine page talks about 1-many and 1-1 but not many-many. Any code example will be highly appreciated

3
голосов
1ответов
325 просмотров

Problems while saving a pre-persisted object in Google App Engine (Java)

I am having problems while saving a pre-persisted JDO object in google-app-engine data store. Basically, in one servlet, I create the object and save it. In another servlet, I read the object, set a bunch of properties and try updating it. The update is through a makePersistent call on Persistenc...

1
голосов
1ответов
748 просмотров

self join in google app engine (java)

I have modified the guestbook example shipped with google app engine (java) to include a parent-child relationship using some sort of a 'self join'. Now my greeting.java file looks like this package guestbook; import java.util.Date; import java.util.List; import javax.jdo.annotations.IdGe...

0
голосов
1ответов
661 просмотров

Google App Engine / JDO : is there a session cache?

Since there is no way to join tables using Google App Engine datastore, I loop over a list of entities and look up the related entities one-by-one using the foreign key value. for (Employee staff: staffList){ Employee manager = pm.getObjectById(Employee.class, staff.getManagerId()); } ...

1
голосов
2ответов
1744 просмотров

JDO integration with hibernate

in JPA, to use hibernate, the only thing need to do is moodify persitence.xml and add in hibernate configuration. May i know with JDO, can just by modifying jdoconfig.xml, able to integrate with hibernate? any reference or example on this?

2
голосов
1ответов
186 просмотров

App Engine Class With Children Of The Same Type

I'm trying to save a tree structure in app engine. My class has a parent and a list of children of the same type. Everything works until I add the children property. There are no errors when I call pm.makePersistent(), but the object is not saved. Does anyone know why this doesn't work? This...

1
голосов
2ответов
3017 просмотров

Java App Engine Datastore: How to query fields of object's inherited classes?

AppEngine 1.2.2. I define a class Product like so: @PersistenceCapable(identityType = IdentityType.APPLICATION, table="Products") public class Product { public Product(String title) { super(); this.title = title; } public String getTitle() { return title; } @Persistent String titl...

3
голосов
1ответов
1722 просмотров

Many-to-Many relationship in DataNucleus (JDO) doesn't persist

I don't manage to persist a many-to-many link with DataNucleus using JDO. I have two classes Book and Shop. This is the orm mapping file: <?xml version="1.0"?> <!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" "http://java.sun.com/dtd/orm...

0
голосов
1ответов
259 просмотров

what is the different jpox and data nucleus implementation of JDO?

what is the different jpox and data nucleus implementation of JDO? both also free implementation right?

0
голосов
2ответов
1419 просмотров

jdo integration with spring..?

is it a must to use kodo jdo if want to integrate with spring? from my understanding kodo is not free. any free implementation of jdo with spring? any such demo come with source code?

4
голосов
3ответов
6153 просмотров

How does ORM work under the covers? Also what is the best way to have persistent objects in Java?

How does ORM work? Are objects serialized into BLOBs? In Java, is JDO still the way to go for this? What else is available? Seems like there was a lot of talk of EJB, direct object serialization, and JDO.

2
голосов
2ответов
563 просмотров

Using JDOQL results in Scala

I'm trying to use a JDO with Google App Engine and Scala. The api for the execute returns Object (but it's really a java collection) and I want to get it into a scala list to iterate over it. My code looks like this so far: val pm = PMF.factory.getPersistenceManager val query = "select from Us...