devng / twig-persist Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/twig-persist
Automatically exported from code.google.com/p/twig-persist
In case all entities should be cleared by their Class the KeyCache remains
filled. This might lead to some strange effects.
Original issue reported on code.google.com by [email protected]
on 18 Feb 2010 at 4:42
All un-iniitialized primitive types can't be converted to default values.
Twig is attempting to set null to boolean and int and is failing with an
IllegalStateExcaption.
See the attached test case.
thanks in advance!
Harsh
Original issue reported on code.google.com by [email protected]
on 24 May 2010 at 9:31
Attachments:
Currently the domain persistence annotations are allowed only on fields access
level. For example:
class Band
{
Set<Musician> members;
@Child Album[] albums; // include the Bands Key in the Key of each Album
}
It is quite nice feature to have possibility to define annotations on methods
access level, like:
class Band
{
private Album[] albums;
@Child
public Album[] getAlbums() {
return albums;
}
}
This approach is very important for the case you have splitted your domain
model into 2 levels - plain objects (DTOs) and domain specific implementation,
for example:
class BandDTO
{
private Album[] albums;
public Album[] getAlbums() {
return albums;
}
}
class Band
{
@Child
public Album[] getAlbums() {
return super.getAlbums();
}
}
This coding style is common in large and scalable applications and it will be
nice to support that also with twig-persists. (also for example when DTO object
is imported from third party library and you cannot change it - or simply don't
want)
Original issue reported on code.google.com by [email protected]
on 9 Oct 2010 at 9:30
Due to Datastore API changes from 1.3.1 und 1.3.2 the class
AsyncPreparedQuery does not compile. The constructor of
QueryResultsSourceImpl now needs an ApiProxy.ApiConfig instance.
Providing null is a (dirty?) quick fix, that let all tests work in the
local environment.
There must be a static reference (or look up mechanism) to the current
ApiConfig.
Original issue reported on code.google.com by sormuras
on 27 Mar 2010 at 5:21
I am trying to perform a query such as this:
Set<String> mySet = new HashSet<String>();
// ... populate the set with some values
Iterator<MyModel> iter =
datastore.find().type(MyModel.class).addFilter("myField", FilterOperator.IN,
mySet).now();
The above, generates the below exception. This worked in the tagged version of
Twig 2.0. It no longer works in the trunk. Fortunately, I am able to get around
this by using google collections to transform my Set into a List, but I have
this kind of code throughout my app since I typically prefer Sets when
filtering by a collection of values.
java.lang.ClassCastException: java.util.HashSet cannot be cast to java.util.List
at com.google.code.twig.standard.RelationTranslator$1.get(RelationTranslator.java:130)
at com.google.code.twig.standard.RelationTranslator$1.get(RelationTranslator.java:125)
at com.google.code.twig.standard.StandardCommonFindCommand.addFilter(StandardCommonFindCommand.java:118)
Original issue reported on code.google.com by [email protected]
on 10 Nov 2010 at 4:37
What steps will reproduce the problem?
1. hg clone https://twig-persist.googlecode.com/hg/ twig-persist
2. mvn package
3. fail.
What is the expected output? What do you see instead?
Downloading:
http://mvn.twig-persist.googlecode.com/hg/com/google/appengine/appengine-testing
/1.3.4/appengine-testing-1.3.4.jar
[INFO] Unable to find resource
'com.google.appengine:appengine-testing:jar:1.3.4' in repository twig
(http://mvn.twig-persist.googlecode.com/hg)
Downloading:
http://google-maven-repository.googlecode.com/svn/repository/com/google/appengin
e/appengine-testing/1.3.4/appengine-testing-1.3.4.jar
[INFO] Unable to find resource
'com.google.appengine:appengine-testing:jar:1.3.4' in repository
google-maven-repository
(http://google-maven-repository.googlecode.com/svn/repository)
Downloading:
http://repo1.maven.org/maven2/com/google/appengine/appengine-testing/1.3.4/appen
gine-testing-1.3.4.jar
[INFO] Unable to find resource
'com.google.appengine:appengine-testing:jar:1.3.4' in repository central
(http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.google.appengine:appengine-testing:jar:1.3.4
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.appengine
-DartifactId=appengine-testing -Dversion=1.3.4 -Dpackaging=jar
-Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file
there:
mvn deploy:deploy-file -DgroupId=com.google.appengine
-DartifactId=appengine-testing -Dversion=1.3.4 -Dpackaging=jar
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.vercer.engine.persist:twig-persist:jar:1.0.2
2) com.google.appengine:appengine-testing:jar:1.3.4
----------
1 required artifact is missing.
for artifact:
com.vercer.engine.persist:twig-persist:jar:1.0.2
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
twig (http://mvn.twig-persist.googlecode.com/hg),
google-maven-repository
(http://google-maven-repository.googlecode.com/svn/repository)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 minutes 38 seconds
[INFO] Finished at: Wed Jun 02 13:47:48 CEST 2010
[INFO] Final Memory: 25M/119M
[INFO] ------------------------------------------------------------------------
What version of the product are you using? On what operating system?
the latest from the repository.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 2 Jun 2010 at 12:13
I'm using NB 6.8 and I can't download javadoc or sources for twig-persist
using "download missing dependencies".
Original issue reported on code.google.com by [email protected]
on 18 May 2010 at 8:32
See http://groups.google.com/group/twig-
persist/browse_thread/thread/46431ad612b12ec7# - m:n relations may fail
loading instances that hold references in HashSets.
See test case for sample scenario.
Original issue reported on code.google.com by [email protected]
on 17 Feb 2010 at 8:06
Attachments:
@Test
public void testOr() {
ds.storeAll(getUserEntities());
RootFindCommand<UserEntity> root = ds.find().type(UserEntity.class);
BranchFindCommand branch = root.branch(MergeOperator.OR);
branch.addChildCommand().addFilter("firstName", FilterOperator.EQUAL, "a");
branch.addChildCommand().addFilter("lastName", FilterOperator.EQUAL, "b");
assertEquals(4, (int) root.returnCount().now()); // IllegalStateException: Too many queries
assertEquals(4, Iterators.size(root.now())); // works fine
}
java.lang.IllegalStateException: Too many queries
at com.google.code.twig.standard.StandardRootFindCommand$2.now(StandardRootFindCommand.java:234)
at com.google.code.twig.standard.StandardRootFindCommand$2.now(StandardRootFindCommand.java:227)
at fi.turkuamk.examples.tests.LocalDatastoreTest.testOr(LocalDatastoreTest.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Original issue reported on code.google.com by [email protected]
on 21 Oct 2010 at 9:15
That should add to 2.0 features.
Now, Twig may support to update 1 Existing Instance.
We need somethings like:
Collection<Band> bands = createAllBands();
datastore.associateAll(bands);
datastore.updateAll(bands);
Thanks in advance.
Hung
Original issue reported on code.google.com by [email protected]
on 3 Sep 2010 at 8:17
What steps will reproduce the problem?
1. the find command with the fetchNoFields() option
2. the entity has a @Embed(polymorphic=true) field.
What is the expected output? What do you see instead?
the expected are the IDs of the entities, instead we get:
2010-04-07 14:41:45,808 [ERROR] test Presenter create
testnet.customware.gwt.dispatch.shared.ActionException: Problem translating
field private com.project.shared.entity.Vehicle
com.project.shared.entity.Driver.vehicle
What version of the product are you using? On what operating system?
1.0 MacOs
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 7 Apr 2010 at 12:47
Branch 2.0
Storing a new instance without an @Id and then updating that instance in the
same ObjectDatastore creates two Entities.
Original issue reported on code.google.com by jdpatterson
on 10 Oct 2010 at 12:01
Sometimes, I need to mark a field as transient to avoid them from be
serialized over Gwt RPC. However, I still want to persist the field to db.
I find that AnnotationStrategy tried to check for @Store annotation before
relying on transient property to persist the field. However,
StrategyObjectDatastore always ignore transient field. This is, some how,
inconsistent.
Original issue reported on code.google.com by [email protected]
on 23 Apr 2010 at 5:26
What steps will reproduce the problem?
1. hg clone https://twig-persist.googlecode.com/hg/ twig-persist
2. cd twig-persist
3. mvn package
What is the expected output? What do you see instead?
Expected
Package is built and a jar is produced.
Instead
Missing artifact 'com.google.appengine:appengine-testing-1.3.1'
What version of the product are you using? On what operating system?
maven 2.2.1 / Ubuntu 9.10
Please provide any additional information below.
Workaround:
mvn install:install-file -Dfile=/path/to/appengine-sdk/lib/testing/appengine-
testing.jar -DgroupId=com.google.appengine -DartifactId=appengine-testing -
Dversion=1.3.1 -Dpackaging=jar -DgeneratePom=true
Original issue reported on code.google.com by [email protected]
on 24 Feb 2010 at 7:19
NPE occurs when invoking datastore.delete over an entity that is not
associated to the session.
Here's the stack:
Caused by: java.lang.NullPointerException
at
com.google.appengine.api.datastore.DatastoreServiceImpl$3.run(DatastoreServiceIm
pl.java:229)
at
com.google.appengine.api.datastore.TransactionRunner.runInTransaction(Transactio
nRunner.java:30)
at
com.google.appengine.api.datastore.DatastoreServiceImpl.delete(DatastoreServiceI
mpl.java:221)
at
com.google.appengine.api.datastore.DatastoreServiceImpl.delete(DatastoreServiceI
mpl.java:207)
at
com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.deleteKeys(A
bstractStatelessObjectDatastore.java:378)
at
com.vercer.engine.persist.standard.StrategyObjectDatastore.delete(StrategyObject
Datastore.java:585)
Original issue reported on code.google.com by [email protected]
on 15 Apr 2010 at 9:34
What steps will reproduce the problem?
1. Create a Model:
class Model {
@Key private Long key;
private List<ChildModel> list;
}
2.
assign list to [new ChildModel(), null]
3.
persist Model
What is the expected output?
Model should be persisted fine
What do you see instead?
Exception thrown:
Caused by: java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at
com.vercer.engine.persist.util.PropertySets.firstValue(PropertySets.java:21)
at
com.vercer.engine.persist.standard.IndependantEntityTranslator.propertiesToTypes
afe(IndependantEntityTranslator.java:31)
at
com.vercer.engine.persist.translator.ListTranslator.propertiesToTypesafe(ListTra
nslator.java:117)
at
com.vercer.engine.persist.translator.ChainedTranslator.propertiesToTypesafe(Chai
nedTranslator.java:62)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.activate(ObjectFieldT
ranslator.java:107)
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Apr 2010 at 10:08
The following simple test block fails:
Future<QueryResultIterator<DummyModel>> futureResult =
datastore.find().type(DummyModel.class).later();
QueryResultIterator<DummyModel> iter = futureResult.get();
The following exception is generated:
java.lang.NoSuchMethodError:
com.google.appengine.api.datastore.QueryResultsSourceImpl.<init>(Lcom/google/app
hosting/api/ApiProxy$ApiConfig;Lcom/google/appengine/api/datastore/FetchOptions;
Lcom/google/appengine/api/datastore/Transaction;)V
at com.google.appengine.api.datastore.AsyncPreparedQuery$2.adapt(AsyncPreparedQuery.java:68)
at com.google.appengine.api.datastore.AsyncPreparedQuery$2.adapt(AsyncPreparedQuery.java:59)
at com.google.code.twig.util.FutureAdaptor.get(FutureAdaptor.java:38)
at com.google.code.twig.standard.StandardRootFindCommand$1.get(StandardRootFindCommand.java:197)
at com.google.code.twig.standard.StandardRootFindCommand$1.get(StandardRootFindCommand.java:186)
at com.schedgy.data.TwigApiTest.testFutureQuery(TwigApiTest.java:27)
I am seeing this on GAE 1.3.8 with the Twig 2.0 beta jar from the maven repo.
Original issue reported on code.google.com by [email protected]
on 5 Nov 2010 at 2:21
import com.google.code.twig.util.generic.GenericTypeReflector;
public class CoreConverters
{
public static void registerAll(CombinedConverter converter)
{
converter.append(new DateToString());
converter.append(new StringToDate());
converter.append(new ClassToString());
converter.append(new StringToClass());
converter.append(new UrltoString());
converter.append(new StringToURI()); -- bug
converter.append(new URItoString());
converter.append(new StringToURI());
converter.append(new LocaleToString());
converter.append(new StringToLocale());
converter.append(new CurrencyToString());
converter.append(new StringToCurrency());
}
Also as naming convention/consistency why not ToUri or ToURL??
Original issue reported on code.google.com by [email protected]
on 6 Sep 2010 at 9:16
The SimpleDateFormat in createFestival() must use Locale.ENGLISH -
otherwise the parsing of all date strings fails iff the default locale is
not english.
Patch attached.
Original issue reported on code.google.com by sormuras
on 27 Mar 2010 at 5:28
Attachments:
What steps will reproduce the problem?
1. Create a generic class :
public class Generic<T> {
@Embed(polymorphic=true) private T genericObject;
public ODSC() {
}
public ODSC(T genericObject) {
this.genericObject = genericObject;
}
public void setObject(T genericObject) {
this.genericObject = genericObject;
}
public T getObject() {
return this.genericObject;
}
}
2. Try to store an instance of this object
ObjectDatastore datastore = new AnnotationObjectDatastore();
Generic <String> gen = new Generic <String>("foo");
datastore.store(container);
3. I get the following error :
java.lang.RuntimeException: not implemented: class
sun.reflect.generics.reflectiveObjects.TypeVariableImpl
at com.vercer.engine.persist.util.generic.GenericTypeReflector.isSuperType(GenericTypeReflector.java:304)
at com.vercer.engine.persist.conversion.DefaultTypeConverter.isSuperType(DefaultTypeConverter.java:75)
at com.vercer.engine.persist.conversion.DefaultTypeConverter.convert(DefaultTypeConverter.java:48)
at com.vercer.engine.persist.translator.ObjectFieldTranslator.typesafeToProperties(ObjectFieldTranslator.java:235)
at com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.instanceToEntity(AbstractStatelessObjectDatastore.java:74)
at com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.store(AbstractStatelessObjectDatastore.java:62)
at com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.store(AbstractStatelessObjectDatastore.java:158)
at mytest.server.test.doPost(test.java:61)
What is the expected output? What do you see instead?
I would like to store my generic classe
What version of the product are you using? On what operating system?
I'm using twig-persist 1.0.1 on OSX
Please provide any additional information below.
GenericTypeReflector.java Line 304, I think, it misses something
Thank you in advance for solving this bug
Emmanuel
Original issue reported on code.google.com by [email protected]
on 22 Apr 2010 at 3:03
Hello,
I have a problem problem to load many object with children : It takes
a very long time
For exemple, when I use the datastore to load 100 instance of my class
Album, on my debug local server, it takes 0.5 seconds, but on app
engine, it takes more than 5 seconds.
Is it normal ?
I think that twig makes a request on the datastore on each
"albums.next();".
Is there a way to load all in a single request ?
I have tested it using JDO and it takes 0.1 second.
Thank you in advance for your help.
// The class :
public class Album {
@Key Long ID;
String _title;
@Child Price _price;
}
public class Price {
String _value;
String _tva;
}
The code used to load 100 instances
Iterator<Album> albums = datastore.find(Album.class);
while (albums.hasNext())
{
Album a = albums.next();
- Masquer le texte des messages précédents -
}
Original issue reported on code.google.com by [email protected]
on 23 Sep 2010 at 7:57
I need to be able to load multiple entities by providing a list of keys. I
tried with find command, but using IN operator and a given set produce this
query: Select * from Entity where key in [1,2,3,4,5] doesn't look like a
correct query (since the key is in Key format, not Long format).
I've seen that you said you had planned to add it to twig (during a debate
with Jeff), just submit an issue so you can notice it.
Original issue reported on code.google.com by [email protected]
on 20 Apr 2010 at 8:13
Have one Parent object and ParentSearchIndex object.
when saving an parent object in database I call this methods:
Parent parent = ... given as argument...
dataStore.store(parent);
ParentSearchIndex searchIndex = indexCreator.createIndex(parent);
dataStore.store(searchIndex, parent);
I try to search in parents like this.
Iterator<Parent> parents = dataStore.find()
.type(ParentsSearchIndex.class) // search for the index
.addFilter("index", Query.FilterOperator.EQUAL, searchQuery.toLowerCase())
.addSort("state", Query.SortDirection.ASCENDING)
.addFilter("state", Query.FilterOperator.LESS_THAN, ParentState.ALIVE.getValue())
.startFrom(0)
.maximumResults(10)
.returnParentsNow(); // query for parents keys only and fetch instances
Expected results is to get 10 parents on ParentSearchIndex object but twig
persist throw NullPointerException.
StandardTypedFindCommand line 144
fetchOptions is null
stack trace:
Caused by: java.lang.NullPointerException
at com.vercer.engine.persist.standard.StandardTypedFindCommand.childEntitiesToParentEntities(StandardTypedFindCommand.java:144)
at com.vercer.engine.persist.standard.StandardSingleParentsCommand.returnParentsNow(StandardSingleParentsCommand.java:19)
at com.vercer.engine.persist.standard.StandardTypedFindCommand.returnParentsNow(StandardTypedFindCommand.java:133)
I using version 1.0.3
If I dont use .startFrom or maximumResults works fine...
Original issue reported on code.google.com by [email protected]
on 25 Aug 2010 at 9:01
I am trying to define a simple parent/child relationship. The child class will
not define its Parent because the Parent could be one of many kinds. When I
annotate the ChildModel in the ParentModel with @Child, I get an exception
complaining about the Key being incomplete. I found that by specifying a the
value of the field @Id with some value, this exception goes away and my test
passes.
The reason I am opening this as a bug, is because I do not (should not) want to
specify the key manually. This behavior is also inconsistent with GAE JDO
behavior. When I was using JDO, I was able to have the @Id managed by the
datastore.
This is using the Twig 2.0-beta3 jar and GAE 1.3.8
public class ParentModel {
// I dont want to have to specify this
//@Id
//protected Long dummyId;
protected String dummyProperty1;
@Child
protected ChildModel child = new ChildModel();
}
public class ChildModel {
protected String dummyProperty1;
}
// Failing test:
ParentModel p = new ParentModel();
datastore.store().instance(p).now();
Stacktrace:
java.lang.IllegalStateException: Key specification is incomplete. You may need
to define an id for instance with kind com_schedgy_data_ParentModel
at com.google.code.twig.standard.KeySpecification.toKey(KeySpecification.java:90)
at com.google.code.twig.standard.ChildRelationTranslator.getParentKey(ChildRelationTranslator.java:19)
at com.google.code.twig.standard.RelationTranslator.instanceToKey(RelationTranslator.java:164)
at com.google.code.twig.standard.RelationTranslator$2.get(RelationTranslator.java:151)
at com.google.code.twig.standard.RelationTranslator$2.get(RelationTranslator.java:148)
at com.google.code.twig.standard.StandardEncodeCommand.dereferencePropertyValue(StandardEncodeCommand.java:58)
at com.google.code.twig.standard.StandardEncodeCommand.transferProperties(StandardEncodeCommand.java:41)
at com.google.code.twig.standard.StandardCommonStoreCommand.instanceToEntity(StandardCommonStoreCommand.java:252)
at com.google.code.twig.standard.StandardSingleStoreCommand.now(StandardSingleStoreCommand.java:51)
at com.google.code.twig.standard.StandardSingleStoreCommand.now(StandardSingleStoreCommand.java:13)
at com.schedgy.data.TwigApiTest.testStoreParentChild(TwigApiTest.java:43)
Original issue reported on code.google.com by [email protected]
on 6 Nov 2010 at 9:16
What steps will reproduce the problem?
1. add member @Embed private ShortBlob blob;
2. store
What is the expected output?
Since a core type should be embedded anyway one would not expect any
problem with this setting.
What do you see instead?
java.lang.IllegalStateException: Cannot convert [B@129c051 to
com.vercer.engine.persist.strategy.DefaultFieldStrategy$1@1d56e03
What version of the product are you using?
Twig 1.0
If this behavior is desired the exception should be more detailed. It took
me some time to find out what was going on.
Original issue reported on code.google.com by [email protected]
on 4 Apr 2010 at 6:04
Fresh check out (revision 22) from the Mercurial repository is missing
Google Collections dependency, which makes my build fail.
Patch inserting the missing dependency and the repository for it attached.
Original issue reported on code.google.com by hleinone
on 2 Feb 2010 at 11:51
Attachments:
Empty collection instances are not stored and therefore returned as null. Need
to differentiate
between a null value, an empty collection and a collection containing null.
Original issue reported on code.google.com by jdpatterson
on 6 Oct 2009 at 2:20
For primitive type boolean and numbers default value are assigned, but char
is not handled and hence an exception is thrown:
IllegalStateException("Unkonwn primitive default" + char).
char by convention takes a Character.MIN_VALUE as default. I added 2 lines
to the PrimitiveConverter to fix it:
line 56:
else if (Character.class == wrapper)
{
source = Character.MIN_VALUE;
}
If you accept this fix, can you please add it to the main twig branch
please? Also look at my another fix in Issue 25.
Original issue reported on code.google.com by [email protected]
on 1 Jun 2010 at 5:59
The ListTranslator has dependency on Google Guice that could be avoided using
Google Collections: see line 57: Lists.newArrayList()
Original issue reported on code.google.com by [email protected]
on 15 Feb 2010 at 1:05
tero-nurminens-imac-2:twig-persist tero$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.google.code.twig:twig-persist:jar:2.0-beta3
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory /Users/tero/t/twig/twig-persist/target
[INFO] [build-helper:add-source {execution: add-source}]
[INFO] Source directory: /Users/tero/t/twig/twig-persist/src/shared added.
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (MacRoman actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
/Users/tero/t/twig/twig-persist/src/main/resources
Downloading:
http://mvn.twig-persist.googlecode.com/hg/com/google/appengine/appengine-api/1.3
.8/appengine-api-1.3.8.pom
[INFO] Unable to find resource 'com.google.appengine:appengine-api:pom:1.3.8'
in repository twig (http://mvn.twig-persist.googlecode.com/hg)
Downloading:
http://repo1.maven.org/maven2/com/google/appengine/appengine-api/1.3.8/appengine
-api-1.3.8.pom
[INFO] Unable to find resource 'com.google.appengine:appengine-api:pom:1.3.8'
in repository central (http://repo1.maven.org/maven2)
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 126 source files to
/Users/tero/t/twig/twig-persist/target/classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (MacRoman actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
/Users/tero/t/twig/twig-persist/src/test/resources
Downloading:
http://mvn.twig-persist.googlecode.com/hg/com/google/appengine/appengine-api/1.3
.8/appengine-api-1.3.8.jar
[INFO] Unable to find resource 'com.google.appengine:appengine-api:jar:1.3.8'
in repository twig (http://mvn.twig-persist.googlecode.com/hg)
Downloading:
http://repo1.maven.org/maven2/com/google/appengine/appengine-api/1.3.8/appengine
-api-1.3.8.jar
[INFO] Unable to find resource 'com.google.appengine:appengine-api:jar:1.3.8'
in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.google.appengine:appengine-api:jar:1.3.8
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.appengine -DartifactId=appengine-api -Dversion=1.3.8 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.appengine -DartifactId=appengine-api -Dversion=1.3.8 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.google.code.twig:twig-persist:jar:2.0-beta3
2) com.google.appengine:appengine-api:jar:1.3.8
----------
1 required artifact is missing.
for artifact:
com.google.code.twig:twig-persist:jar:2.0-beta3
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
twig (http://mvn.twig-persist.googlecode.com/hg)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13 seconds
[INFO] Finished at: Thu Nov 11 16:16:11 EET 2010
[INFO] Final Memory: 25M/81M
[INFO] ------------------------------------------------------------------------
Original issue reported on code.google.com by [email protected]
on 11 Nov 2010 at 2:23
what about using the standard svn structure with trunk, branches, tags. Then
you could tag releases. It think it would seem odd to a developer assessing the
product that this structure doesn't exist.
Original issue reported on code.google.com by [email protected]
on 18 Jun 2010 at 9:18
I am getting a NPE from the StandardDecodeCommand when doing a bulk load by ID:
Set<Long> ids = new HashSet<Long>();
for (int i = 0; i < 100; i++) {
ids.put(datastore.store().instance(new DummyModel()).now().getId());
}
Map<Long, DummyModel> results = datastore.loadAll(DumyModel.class, ids);
Instead of getting a Map with 100 values, I get the below NPE. Looking at the
source of the class, it looks like this is when no Keys are loaded. The
variable 'missing' will remain null if the given Keys collection is empty.
java.lang.NullPointerException
at com.google.code.twig.standard.StandardDecodeCommand.keysToInstances(StandardDecodeCommand.java:156)
at com.google.code.twig.standard.StandardMultipleTypedLoadCommand.now(StandardMultipleTypedLoadCommand.java:43)
at com.google.code.twig.standard.TranslatorObjectDatastore.loadAll(TranslatorObjectDatastore.java:208)
at com.schedgy.core.dao.BaseDao.findByIds(BaseDao.java:115)
This is with GAE 1.3.8 and the Twig 2.0 beta from the MVN repo.
Original issue reported on code.google.com by [email protected]
on 5 Nov 2010 at 4:50
version : twig-persist-2.0-beta.jar
see my questions at the end.
package com.rvanker.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.rvanker.client.action.Action;
import com.rvanker.client.action.Response;
import com.rvanker.domain.Ca;
import com.rvanker.domain.Pf;
@RemoteServiceRelativePath("investments")
public interface InvestmentsService extends RemoteService {
Ca storeCa(Ca ca) throws IllegalArgumentException;
Ca getCaByName(String s);
void addPfToCa (Ca ca, Pf pf);
void addPfToCaWithAssociate (Ca ca, Pf pf);
void deletePfFromCa(Ca ca, Pf pf);
}
--------------------------------------------------------------------------------
---------------------
package com.rvanker.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.rvanker.client.action.Action;
import com.rvanker.client.action.Response;
import com.rvanker.domain.Ca;
import com.rvanker.domain.Pf;
public interface InvestmentsServiceAsync {
void storeCa(Ca ca,AsyncCallback<Ca> callback) throws IllegalArgumentException;
void getCaByName(String s,AsyncCallback callback);
void addPfToCa (Ca ca, Pf pf, AsyncCallback callback);
void addPfToCaWithAssociate (Ca ca, Pf pf, AsyncCallback callback);
void deletePfFromCa(Ca ca, Pf pf,AsyncCallback callback);
}
--------------------------------------------------------------------------------
---------------------
public class InvestmentsServiceImpl extends RemoteServiceServlet implements
InvestmentsService{
@Override
public Ca storeCa(Ca ca) {
// create the datastore instance directly - allows sub-classing
ObjectDatastore datastore = new AnnotationObjectDatastore();
Key k = datastore.store(ca);
return ca;
}
@Override
public Ca getCaByName(String s) {
ObjectDatastore datastore = new AnnotationObjectDatastore();
Ca x = datastore.load(Ca.class,s);
return x;
}
@Override
public void deletePfFromCa(Ca ca1, Pf pf) {
ObjectDatastore datastore = new AnnotationObjectDatastore();
Ca ca = datastore.load(Ca.class,ca1.getName());
List<Pf> tmp = ca1.getPfs();
System.out.println ( " Before tmp.size " + tmp.size());
boolean x = tmp.remove(pf);
ca.setPfs(tmp);
System.out.println ( " delete result " + x + " tmp.size " + tmp.size());
datastore.update(ca);
}
@Override
public void addPfToCaWithAssociate(Ca ca1, Pf pf) {
ObjectDatastore datastore = new AnnotationObjectDatastore();
datastore.associate(ca1);
List<Pf> tmp = ca1.getPfs();
System.out.println (" addPfToCaWithAssociate : Before tmp.size " + tmp.size());
tmp.add(pf);
ca1.setPfs(tmp);
System.out.println (" addPfToCaWithAssociate : After tmp.size " + tmp.size());
datastore.update(ca1);
}
@Override
public void addPfToCa(Ca ca1, Pf pf) {
ObjectDatastore datastore = new AnnotationObjectDatastore();
Ca ca = datastore.load(Ca.class,ca1.getName());
ca.getPfs().add(pf);
datastore.update(ca);
}
}
--------------------------------------------------------------------------------
---------------------
package com.rvanker.domain;
import java.io.Serializable;
import java.util.List;
import com.google.code.twig.annotation.Activate;
import com.google.code.twig.annotation.Child;
import com.google.code.twig.annotation.Key;
public class Ca implements Serializable {
@Key
String name;
@Activate(1) @Child List<Pf> pfs;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Pf> getPfs() {
return pfs;
}
public void setPfs(List<Pf> pfs) {
this.pfs = pfs;
}
}
--------------------------------------------------------------------------------
---------------------
package com.rvanker.domain;
import java.io.Serializable;
public class Pf implements Serializable {
String name;
int volgorde;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getVolgorde() {
return volgorde;
}
public void setVolgorde(int volgorde) {
this.volgorde = volgorde;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + volgorde;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Pf other = (Pf) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (volgorde != other.volgorde)
return false;
return true;
}
}
--------------------------------------------------------------------------------
---------------------
package com.rvanker.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import
com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
import com.rvanker.domain.Ca;
import com.rvanker.domain.Pf;
import com.rvanker.server.InvestmentsServiceImpl;
public class TwigTest {
private final LocalServiceTestHelper helper =
new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
@Before
public void setUp() {
helper.setUp();
}
@After
public void tearDown() {
helper.tearDown();
}
@Test
public void testNormal() {
InvestmentsService service = new InvestmentsServiceImpl();
Ca c = new Ca();
String key = "twigtest" + new Date().toString();
c.setName(key);
List<Pf> x = new ArrayList<Pf>();
Pf pf1 = new Pf();
pf1.setName("Apf1 " + new Date().toString());
Pf pf2 = new Pf();
pf2.setName("Apf2 " + new Date().toString());
x.add(pf1);
x.add(pf2);
c.setPfs(x);
Ca result = service.storeCa(c);
System.out.println ("terug : " + result.getName());
Assert.assertEquals(key,result.getName());
Ca read = service.getCaByName(key);
Assert.assertEquals(key,read.getName());
Assert.assertEquals(2,read.getPfs().size());
Pf pf3 = new Pf();
pf3.setName("Apf3 " + new Date().toString());
service.addPfToCa(read, pf3);
Ca read2 = service.getCaByName(key);
Assert.assertEquals(key,read2.getName());
Assert.assertEquals(3,read2.getPfs().size());
// if you use service.deletePfFromCa(read2, pf2); then it is ok.
// "read2" instead of "read", but that should not make a difference !!!
// please explain ?
service.deletePfFromCa(read, pf2);
Ca read3 = service.getCaByName(key);
Assert.assertEquals(key,read3.getName());
Assert.assertEquals(2,read3.getPfs().size());
}
@Test
public void testWithAssociate() {
InvestmentsService service = new InvestmentsServiceImpl();
Ca c = new Ca();
String key = "twigtest" + new Date().toString();
c.setName(key);
List<Pf> x = new ArrayList<Pf>();
Pf pf1 = new Pf();
pf1.setName("Apf1 " + new Date().toString());
Pf pf2 = new Pf();
pf2.setName("Apf2 " + new Date().toString());
x.add(pf1);
x.add(pf2);
c.setPfs(x);
Ca result = service.storeCa(c);
System.out.println ("terug : " + result.getName());
Assert.assertEquals(key,result.getName());
Ca read = service.getCaByName(key);
Assert.assertEquals(key,read.getName());
Assert.assertEquals(2,read.getPfs().size());
Pf pf3 = new Pf();
pf3.setName("Apf3 " + new Date().toString());
service.addPfToCaWithAssociate(read, pf3);
// Ca read2 = service.getCaByName(key);
// Assert.assertEquals(key,read2.getName());
// Assert.assertEquals(3,read2.getPfs().size());
//
// service.deletePfFromCa(read, pf2);
//
// Ca read3 = service.getCaByName(key);
// Assert.assertEquals(key,read3.getName());
// Assert.assertEquals(2,read3.getPfs().size());
}
}
I have 3 questions :
- why is import com.google.code.twig.annotation.Key deprecated ? How to solve
it.
- testNormal() : see the code : please explain?
- testWithAssociate() : what causes the error below ?
java.lang.IllegalArgumentException: Associating entity does not have complete
key: <Entity [com_rvanker_domain_Ca("twigtestThu Sep 30 17:00:36 CEST
2010")/com_rvanker_domain_Pf(no-id-yet)]:
name = Apf1 Thu Sep 30 17:00:36 CEST 2010
volgorde = 0
>
at com.google.code.twig.standard.StandardCommonStoreCommand.entitiesToKeys(StandardCommonStoreCommand.java:317)
at com.google.code.twig.standard.StandardMultipleStoreCommand.now(StandardMultipleStoreCommand.java:32)
at com.google.code.twig.standard.RelationTranslator.instancesToKeys(RelationTranslator.java:189)
Original issue reported on code.google.com by [email protected]
on 30 Sep 2010 at 3:06
* Property types (at least Enum) which are translated for storing should also
be translated when fetching
* Affected version: 2.0-beta3
* TestCase for the issue (using Twig's test models)
@Test
public void testIssue41 {
// ObjectDatastore ods = ...
try {
ods.find().type().
addFilter("hair", FilterOperator.EQUAL, Band.HairStyle.LONG_LIKE_A_GIRL).
now(); }
catch(IllegalArgumentException e) {
fail("Issue41: Enum values not filtered correctly!");
}
}
------ Stack trace (with same object types) -------
java.lang.IllegalArgumentException: gender:
fi.turkuamk.examples.tests.LocalDatastoreTest$UserEntity$GenderEnum is not a
supported property type.
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:157)
at com.google.appengine.api.datastore.Query$FilterPredicate.<init>(Query.java:549)
at com.google.appengine.api.datastore.Query.addFilter(Query.java:235)
at com.google.code.twig.standard.StandardCommonFindCommand.applyFilters(StandardCommonFindCommand.java:141)
at com.google.code.twig.standard.StandardRootFindCommand.newQuery(StandardRootFindCommand.java:525)
at com.google.code.twig.standard.StandardCommonFindCommand.queries(StandardCommonFindCommand.java:112)
at com.google.code.twig.standard.StandardCommonFindCommand.getValidatedQueries(StandardCommonFindCommand.java:127)
at com.google.code.twig.standard.StandardRootFindCommand.now(StandardRootFindCommand.java:454)
at com.google.code.twig.standard.StandardRootFindCommand.now(StandardRootFindCommand.java:30)
at fi.turkuamk.examples.tests.LocalDatastoreTest.testEnumFilterException(LocalDatastoreTest.java:332)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Original issue reported on code.google.com by [email protected]
on 24 Oct 2010 at 12:34
http://code.google.com/events/io/2009/sessions/BuildingScalableComplexApps.html
is the new
http://code.google.com/events/io/sessions/BuildingScalableComplexApps.html
Original issue reported on code.google.com by [email protected]
on 17 Oct 2009 at 10:09
What steps will reproduce the problem?
1. Look at
http://code.google.com/p/twig-persist/wiki/Configuration#Parent-Child_Relationsh
ips
2. Class Band has this line: @Key name; // the key will contain the band name
which must be unique
What is the expected output? What do you see instead?
3. Should read @Key String name;
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Aug 2010 at 5:53
What steps will reproduce the problem?
1. Classes: Element, Content, Photo extends Content, Video extends Content
2. Class A {@Embed (polymorphic = true) Content c; }
3. Create elements with photo content, elements with video content
What is the expected output? What do you see instead?
elements are well stored in the datastore (dev datastore browser),
With a simple "get all", some objects are not returned some are returned twice,
some have worng
field value.
Strange point: content%24class field is empty
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 6 Apr 2010 at 1:50
keyCache.evictInstance(instance); happens twice calling
StrategyTypeSafeDatastore.deleteAll - once in the loop and once transforming
the collection.
Original issue reported on code.google.com by [email protected]
on 15 Feb 2010 at 8:01
This is a followup to
http://groups.google.com/group/twig-persist/browse_thread/thread/c3e1...
For me,
datastore.getService().delete(key);
doesn't seem to have any effect. Reading the entity again in a null
variable sets it with data.
datastore.delete(entity);
works as expected.
Here's a test case, wrote blindly as twig2 doesn't compile for me
right now
public void deleteKeyTest() {
ObjectDatastore od = new AnnotationObjectDatastore();
Restaurant restaurant = new Restaurant();
restaurant.name = "test";
Key restaurantKey = od.store(restaurant);
Restaurant restaurant2;
restaurant2 = od.load(restaurantKey);
assertTrue("stored entity exists",
restaurant.name.equals(restaurant2.name));
od.getService().delete(restaurantKey);
restaurant2 = null;
restaurant2 = od.load(restaurantKey);
assertTrue("deleted entity exists", null == restaurant2);
}
Please provide any additional information below.
In addition, would it be possible for twig to offer a "native" delete(Key key)
implementation?
Even if behind all it does is getService().delete(key), having this
means twig offers full CRUD support. It would also have a unit test on
it, guaranteeing delete works on each release.
Perhaps a delete() fluent command would be best for all the options.
Similar to load()
od.delete().key(key).now()
Original issue reported on code.google.com by [email protected]
on 9 Nov 2010 at 7:44
Unsorted merged queries return duplicate results.
Original issue reported on code.google.com by jdpatterson
on 25 Oct 2010 at 3:10
Class A{}
Class B{}
Class C{}
where A is parent of B, B is parent of C, ancestor queries fail to find
depth=2+ relationship
dumping the keys returned from the datastore shows that B key will be A(1)/B(2)
but C Key will be B(2)/C(3) where the datastore would operate on the basis of
querying and allocating keyspace on full length ancestry paths.
ds.find().type(C.class).ancestor( A ) would fail
this orphans twig-persist objects from lowlevel API objects stored using the
documented sdk parent namespace id allocation features.
Original issue reported on code.google.com by [email protected]
on 15 Aug 2010 at 11:24
Please follow the thread:
http://groups.google.com/group/twig-
persist/browse_thread/thread/63e1eb8dd5aa0dc3/bcdf8c4c6f3f5f5a#bcdf8c4c6f3f
5f5a
What is the expected output? What do you see instead?
The expected output is a null value, but I get an IllegalStateException:
path not found exception.
What version of the product are you using? On what operating system?
version 1.0.1
Original issue reported on code.google.com by [email protected]
on 13 May 2010 at 5:19
Many existing applications make heavy use of the GAE Key and it would be
difficult for these applications to switch to Twig since it abstracts away the
notion of the Key. It would be nice if there was an annotation that we could
use to mark fields as being the Key objects or String encoded Keys.
Original issue reported on code.google.com by [email protected]
on 11 Nov 2010 at 12:56
The code in 1.0.2 is:
public RootFindCommand<T> maximumResults(int limit)
{
if (this.options == null)
{
this.options = FetchOptions.Builder.withLimit(limit);
}
else
{
this.options.offset(limit);
}
return this;
}
It should be:
public RootFindCommand<T> maximumResults(int limit)
{
if (this.options == null)
{
this.options = FetchOptions.Builder.withLimit(limit);
}
else
{
this.options.limit(limit);
}
return this;
}
Original issue reported on code.google.com by [email protected]
on 16 Jun 2010 at 4:27
This is using the Twig 2.0-beta3 jar and GAE 1.3.8
As explained in group articles use @Child annotation on field in parent class
then annotation child class with @Entity(allocateIdsBy=50) to automatically
allocate id and so avoid the 'chicken and egg' problem.
In class: StandardCommonStoreCommand
Line 285 : KeyRange range = datastore.allocatedIdRanges.get(kindAndParent);
Null pointer exception thrown as allocatedIdRanges is not initialized.
Tried quick fix: Assigning the variable to new HashMap allowed application to
run.
Original issue reported on code.google.com by [email protected]
on 8 Nov 2010 at 10:28
Having my application deployed on AppEngine I get following exception
loading an entity:
Caused by: java.lang.IllegalAccessError: tried to access method
com.google.appengine.repackaged.com.google.common.collect.Iterators.forArray
([Ljava/lang/Object;II)Lcom/google/appengine/repackaged/com/google/common/co
llect/UnmodifiableIterator; from class
com.vercer.util.collections.ArraySortedSet
at
com.vercer.util.collections.ArraySortedSet.iterator(ArraySortedSet.java:42)
at
com.vercer.engine.persist.util.PropertySets.firstValue(PropertySets.java:20)
at
com.vercer.engine.persist.translator.DirectTranslator.propertiesToTypesafe(D
irectTranslator.java:18)
at
com.vercer.engine.persist.translator.ChainedTranslator.propertiesToTypesafe(
ChainedTranslator.java:67)
at
com.vercer.engine.persist.translator.ListTranslator.propertiesToTypesafe(Lis
tTranslator.java:47)
at
com.vercer.engine.persist.translator.ChainedTranslator.propertiesToTypesafe(
ChainedTranslator.java:67)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.activate(ObjectFi
eldTranslator.java:109)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.propertiesToTypes
afe(ObjectFieldTranslator.java:61)
at
com.vercer.engine.persist.TranslatorTypesafeDatastore.toTypesafe(TranslatorT
ypesafeDatastore.java:270)
at
com.vercer.engine.persist.StrategyTypesafeDatastore.toTypesafe(StrategyTypes
afeDatastore.java:290)
at
com.vercer.engine.persist.TranslatorTypesafeDatastore.keyToInstance(Translat
orTypesafeDatastore.java:324)
at
com.vercer.engine.persist.StrategyTypesafeDatastore.keyToInstance(StrategyTy
pesafeDatastore.java:310)
at
com.vercer.engine.persist.TranslatorTypesafeDatastore.load(TranslatorTypesaf
eDatastore.java:310)
Original issue reported on code.google.com by [email protected]
on 9 Feb 2010 at 10:26
Because multi-valued properties are used to store component collections and
these may only be one dimensional, the path must be used to differentiate
the items.
propertyA.propertyA1
propertyA.propertyA2:0
propertyA.propertyA2:1
propertyA.propertyA2:2
Original issue reported on code.google.com by jdpatterson
on 13 Jan 2010 at 4:57
What steps will reproduce the problem?
1. A unitialized boolean value in a class
java.lang.IllegalArgumentException: Can not set boolean field
org.twig.example.isPhysicallyChallenged to null value
boolean fields can't be set to null and hence the ObjectFieldTranslator is
throwing this error.
Original issue reported on code.google.com by [email protected]
on 19 May 2010 at 6:28
There seems to be a problem with the CollectionConverter.
Attached is the failing test case.
I get an IllegalStateException.
See the stack trace:
java.lang.IllegalStateException: Problem translating field private
com.twig.example.BirthInformation com.twig.example.Person.birthInformation
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.activate(ObjectF
ieldTranslator.java:112)
at
com.vercer.engine.persist.standard.StrategyObjectDatastore$3.activate(Strat
egyObjectDatastore.java:220)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.propertiesToType
safe(ObjectFieldTranslator.java:57)
at
com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.toTypes
afe(AbstractStatelessObjectDatastore.java:272)
at
com.vercer.engine.persist.standard.StrategyObjectDatastore.toTypesafe(Strat
egyObjectDatastore.java:429)
at
com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.keyToIn
stance(AbstractStatelessObjectDatastore.java:310)
at
com.vercer.engine.persist.standard.StrategyObjectDatastore.keyToInstance(St
rategyObjectDatastore.java:449)
at
com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.load(Ab
stractStatelessObjectDatastore.java:296)
at
com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.interna
lLoad(AbstractStatelessObjectDatastore.java:232)
at
com.vercer.engine.persist.standard.StrategyObjectDatastore.load(StrategyObj
ectDatastore.java:526)
at
com.vercer.engine.persist.standard.AbstractStatelessObjectDatastore.load(Ab
stractStatelessObjectDatastore.java:199)
at com.wulfpak.test.TestPerson.testPerson(TestPerson.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
9)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:8
3)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRe
ference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestR
unner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestR
unner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner
.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunne
r.java:197)
Caused by: java.lang.IllegalArgumentException: Unsupported Collection type
java.util.EnumSet<com.twig.example.ProofDocumentTypeCode>. Try declaring
the interface instead of the concrete collection type.
at
com.vercer.engine.persist.conversion.CollectionConverter.convert(Collection
Converter.java:130)
at
com.vercer.engine.persist.conversion.CombinedTypeConverter.convert(Combined
TypeConverter.java:37)
at
com.vercer.engine.persist.conversion.DefaultTypeConverter.convert(DefaultTy
peConverter.java:56)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.activate(ObjectF
ieldTranslator.java:128)
at
com.vercer.engine.persist.standard.StrategyObjectDatastore$3.activate(Strat
egyObjectDatastore.java:220)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.propertiesToType
safe(ObjectFieldTranslator.java:57)
at
com.vercer.engine.persist.translator.ListTranslator.propertiesToTypesafe(Li
stTranslator.java:48)
at
com.vercer.engine.persist.translator.ObjectFieldTranslator.activate(ObjectF
ieldTranslator.java:107)
... 30 more
Original issue reported on code.google.com by [email protected]
on 26 May 2010 at 9:11
Attachments:
What steps will reproduce the problem?
Persist an object with @Embedded (previously @Embed) annotation on a
Map<String,String>.
What is the expected output? What do you see instead?
Since one can embed a List, I was hoping that one could also embed a Map. You
get the following stacktrace with v2.0-alpha release, but I also had the same
problem with latest v2.0 branch code:
Caused by: java.lang.IllegalStateException: Final field private final int
java.lang.String.count cannot be stored
at com.google.code.twig.annotation.AnnotationStrategy.store(AnnotationStrategy.java:67)
at com.google.code.twig.standard.StrategyObjectDatastore$StrategyObjectFieldTranslator.stored(StrategyObjectDatastore.java:554)
at com.google.code.twig.translator.ObjectFieldTranslator.encode(ObjectFieldTranslator.java:298)
at com.google.code.twig.translator.MapTranslator.encode(MapTranslator.java:86)
at com.google.code.twig.translator.ListTranslator.encode(ListTranslator.java:242)
at com.google.code.twig.translator.ObjectFieldTranslator.encode(ObjectFieldTranslator.java:321)
at com.google.code.twig.standard.StandardCommonStoreCommand.instanceToEntity(StandardCommonStoreCommand.java:213)
at com.google.code.twig.standard.StandardSingleStoreCommand.now(StandardSingleStoreCommand.java:51)
at com.google.code.twig.standard.StrategyObjectDatastore.store(StrategyObjectDatastore.java:159)
at com.google.code.twig.standard.StrategyObjectDatastore.storeOrUpdate(StrategyObjectDatastore.java:249)
...
What version of the product are you using? On what operating system?
2.0 branch
Original issue reported on code.google.com by [email protected]
on 7 Sep 2010 at 3:35
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.