Re: [Neo4j] SDG 2.0.0.M1 cross-store does not work properly

2011-11-07 Thread Marcin Zasepa
Hi Michael thanks a lot for your hints,
below test which expose the problem. It seems as follows: after
deserialization entity state is null. Maybe this is acceptable behavior -
meaning entities are not supposed to be serializable, or it is an issue
which should be fixed?
I added this test case to WorldRepositoryTest in
spring-data-neo4j-hello-worlds-aspects project:

@Test
public void testSerialization() throws Exception {

World myWorld = new World( mine, 0 ).persist();
EntityStateNode entityState = myWorld.getEntityState();
assertNotNull(entityState);
IterableWorld foundWorlds = galaxy.findAll();
World mine = foundWorlds.iterator().next();
byte[] serializedWorld = SerializationUtils.serialize(mine);
World deserializedWorld = (World)
SerializationUtils.deserialize(serializedWorld);
assertNotNull(deserializedWorld);
EntityStateNode deserializedEntityState =
deserializedWorld.getEntityState();
assertNotNull(deserializedEntityState); //Test fails at this
assertion
template.save(deserializedWorld);//This invocation leads to NPE
since entityState is null
assertEquals(myWorld.getName(),deserializedWorld.getName());
}

Running similar operation in project with no aspectj doesn't lead to this
problem.
Thanks a lot for your feedback.
Greets from Berlin, Marcin


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/SDG-2-0-0-M1-cross-store-does-not-work-properly-tp3481372p3488532.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] SDG 2.0.0.M1 cross-store does not work properly

2011-11-06 Thread Marcin Zasepa
Hi Michael,
thanks a lot for you fast response. I run the tests against SNAPSHOT and it
works. I had also problems with mapping of enums and it works either now.
Great job! thanks a lot.

BTW: Could you point any docs or examples how to use alternative non-aspectj
mapping approach, maybe this approach will hell solve the problem with
serializing of domain object. Currently invoking persist() on deserialized
object causes NPE, which is pretty problematic when working with wicket.

Thanks a lot in advance
Greets, Marcin

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/SDG-2-0-0-M1-cross-store-does-not-work-properly-tp3481372p3485361.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] SDG 2.0.0.M1 cross-store does not work properly

2011-11-06 Thread Michael Hunger
There is are two examples in the current snapshot, hello-worlds and cineasts 
(w/o -*)

Could you share the use-case + NPE that you've described?

Thanks a lot

Michael

mh$ ls -1 spring-data-neo4j-examples/
cineasts [x]
cineasts-aspects
cineasts-rest
hello-worlds  [x]
hello-worlds-aspects
imdb
myrestaurants-original
myrestaurants-social

Am 06.11.2011 um 22:33 schrieb Marcin Zasepa:

 Hi Michael,
 thanks a lot for you fast response. I run the tests against SNAPSHOT and it
 works. I had also problems with mapping of enums and it works either now.
 Great job! thanks a lot.
 
 BTW: Could you point any docs or examples how to use alternative non-aspectj
 mapping approach, maybe this approach will hell solve the problem with
 serializing of domain object. Currently invoking persist() on deserialized
 object causes NPE, which is pretty problematic when working with wicket.
 
 Thanks a lot in advance
 Greets, Marcin
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/SDG-2-0-0-M1-cross-store-does-not-work-properly-tp3481372p3485361.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] SDG 2.0.0.M1 cross-store does not work properly

2011-11-05 Thread Michael Hunger
March,

could you try to test this on snapshot?

I solved an issue regarding that.

I'll add the test you mentioned as well

Thanks for the feedback.

Michael

mobile mail please excuse brevity and typos

Am 04.11.2011 um 23:00 schrieb Marcin Zasepa se...@vp.pl:

 Hi guys,
 i just migrated from SDG 1.1 to 2.0.0.M1 and I am facing problem with
 cross-store functionality. I have some entities which are partially stored
 in Neo and partially in rdbms. Everything works ok so far entity class has
 only primitive members or sets of other entities mapped using @RelatedTo
 annotation. Problems begin if I have one entity /A/ with partial=true which
 refers with @OneToMany another entity /B/ which is pure JPA entity. Trying
 to save entity *A *i get an exception: Type class B is neither a
 @NodeEntity nor a @RelationshipEntity.This kind of mappings worked properly
 with SDG 1.1. In order to reproduce this problem in environment independent
 from my application i add simple relation to the User test class in
 spring-data-neo4j-cross-store tests: 
 @Entity
 @NodeEntity(partial = true)
 public class User {
   .
  @OneToMany(mappedBy=user)
private SetLocation locations;
 }
 , where Location class is defined as follows:
 @Entity
 @Table(name = LOCATION)
 public class Location {
 
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = id)
private Long id;

@ManyToOne
@JoinColumn(name=userId)
private User user;

 }
 
 Running ReccomendationTest after this changes, causes that the first test
 fails with an exception:
 org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type
 class org.springframework.data.neo4j.partial.Location is neither a
 @NodeEntity nor a @RelationshipEntity. What is even more interesting is that
 it happens only to the first run test, that is why two other test are not
 failing but if i invoke only one test for example the second one:
 jpaUserCanHaveGraphProperties then it fails with the same exception. 
 Could you have a look on that and let me know if I am something changed in
 SDG 2.0 or it is indeed bug.
 Thanks in advance! Greets.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/SDG-2-0-0-M1-cross-store-does-not-work-properly-tp3481372p3481372.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] SDG 2.0.0.M1 cross-store does not work properly

2011-11-04 Thread Marcin Zasepa
Hi guys,
i just migrated from SDG 1.1 to 2.0.0.M1 and I am facing problem with
cross-store functionality. I have some entities which are partially stored
in Neo and partially in rdbms. Everything works ok so far entity class has
only primitive members or sets of other entities mapped using @RelatedTo
annotation. Problems begin if I have one entity /A/ with partial=true which
refers with @OneToMany another entity /B/ which is pure JPA entity. Trying
to save entity *A *i get an exception: Type class B is neither a
@NodeEntity nor a @RelationshipEntity.This kind of mappings worked properly
with SDG 1.1. In order to reproduce this problem in environment independent
from my application i add simple relation to the User test class in
spring-data-neo4j-cross-store tests: 
@Entity
@NodeEntity(partial = true)
public class User {
   .
  @OneToMany(mappedBy=user)
private SetLocation locations;
}
, where Location class is defined as follows:
@Entity
@Table(name = LOCATION)
public class Location {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = id)
private Long id;

@ManyToOne
@JoinColumn(name=userId)
private User user;

}

Running ReccomendationTest after this changes, causes that the first test
fails with an exception:
org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type
class org.springframework.data.neo4j.partial.Location is neither a
@NodeEntity nor a @RelationshipEntity. What is even more interesting is that
it happens only to the first run test, that is why two other test are not
failing but if i invoke only one test for example the second one:
jpaUserCanHaveGraphProperties then it fails with the same exception. 
Could you have a look on that and let me know if I am something changed in
SDG 2.0 or it is indeed bug.
Thanks in advance! Greets.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/SDG-2-0-0-M1-cross-store-does-not-work-properly-tp3481372p3481372.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user