Results 1 to 2 of 2

Thread: Error in @RelatedTo Spring Data graph

  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Default Error in @RelatedTo Spring Data graph

    I am trying to play with Spring Data Graph with neo4j.

    My example model has to entities Artists and Albums.

    Artists "Perform" Albums is the relationship.

    My Artist Class looks like this

    @NodeEntity
    public class Artist {
    private Long id;
    @Indexed
    private String name;
    private String dob;
    private String bio;

    @RelatedTo(type="PERFORMS", elementClass=Album.class);
    private List<Album> albums;
    ...
    }

    Album Class:

    @NodeEntity
    public class Album {
    private Long id;
    private String name;
    private String year;
    private String description;
    private String type;
    private String language;
    ...
    }

    Now I have an error in the:
    @RelatedTo(type="PERFORMS", elementClass=Album.class);
    private List<Album> albums;

    It says: Cannot convert from Class<Album> to Class<? extends NodeBacked>

    Can someone help me with that?

    Thanks,
    Srikanth

  2. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    What IDE are you using?

    If you use Eclipse please update the AspectJ plugin to the latest version: http://download.eclipse.org/tools/ajdt/36/dev/update

    Otherwise this is just an visual Editor error (that should be gone after the update). Maven should still build fine.

    Also you might have a look at the answer from Thomas Risberg on this:
    https://jira.springsource.org/browse/DATAGRAPH-39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •