I am using GraphDatabaseContext, sorry, I should have been clear on that.
@Autowired
private GraphDatabaseContext gds;
Movie retrievedMovie = (Movie)gds.getNodeById(rainman.getNodeId());
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Michael Hunger
Sent: Monday, August 15, 2011 2:00 PM
To: Neo4j user discussions
Cc: Neo4j user discussions
Subject: Re: [Neo4j] Using Data Graph and @NodeEntity, API methods not
compatible
you shouldn't use gds with annozated enities
the are no nodes etc but the delegate to nodes & rels
use graphdatabasecontext
or the repositories
please see the docs I'm on vacation
mobile mail please excuse brevity and typos
Am 15.08.2011 um 19:38 schrieb "etc1" <[email protected]>:
> When annotating an entity class with @NodeEntity, such as ...
>
> @NodeEntity
> public class Movie {.....
>
> ..this appears to cause many neo4j api methods to become incompatible
> with the custom entity type, in this case Movie, for example...
>
> Movie rainman = new Movie("Rain Man", 1986).persist();
>
> //can't use Movie type here since, ClassCastException on
> org.neo4j.kernel.impl.core.NodeProxy
> Movie retrievedMovie = (Movie)gds.getNodeById(rainman.getNodeId());
>
> //can't use Movie type, add() take only Node type
> gds.getIndex(Movie.class).add(rainman, "name", "Rain Man");
>
>
>
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user