Discussion:
Could not determine type for: java.util.Set for Jpa/Neo4J Cross Store Entity
apprentice321-gM/Ye1E23mwN+
2014-06-03 15:23:34 UTC
Permalink
I have a Jpa entity which also acts as a Neo4j cross store. Most of the
fields in the entity are saved to Mysql database except the Collection
'followers', which is stored in Neo4j. The problem is with the Collection
'followers'. it throws the exception "hibernate MappingException: Could not
determine type for: java.util.Set". A quick search yields a bunch of Jpa
Related solutions (e.g. adding onetomany annotation to the field etc) which
I assume is not relevant in this case because the collection is saved in
Neo4j not Mysql.

StacktraceCaused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
-------@***@Table(name="game")@NodeEntity(partial = true)public class Game implements Serializable{
private static final long serialVersionUID = 1L;

@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch

@GraphProperty
private Set<Account> followers = new HashSet<Account>();



@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name; ....

//Accessors

public Long getGameId() {
return gameId;
}



public void setGameId(Long gameId) {
this.gameId = gameId;
}...
@Override
public String toString(){
return "...";
}


}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)@EnableNeo4jRepositories(value={".."})public class Neo4JConfig extends Neo4jConfiguration{

@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;

}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}

@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
apprentice321-gM/Ye1E23mwN+
2014-06-03 15:38:32 UTC
Permalink
By adding "@Transient" above the collection causes the Exception to go away
but it is not saved permanently, Object returned upon initial svae seems to
be positive but subsequent queries for the same object returns null.

Any ideas?
Post by apprentice321-gM/Ye1E23mwN+
I have a Jpa entity which also acts as a Neo4j cross store. Most of the
fields in the entity are saved to Mysql database except the Collection
'followers', which is stored in Neo4j. The problem is with the Collection
'followers'. it throws the exception "hibernate MappingException: Could not
determine type for: java.util.Set". A quick search yields a bunch of Jpa
Related solutions (e.g. adding onetomany annotation to the field etc) which
I assume is not relevant in this case because the collection is saved in
Neo4j not Mysql.
StacktraceCaused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
private static final long serialVersionUID = 1L;
@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch
@GraphProperty
private Set<Account> followers = new HashSet<Account>();
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name; ....
//Accessors
public Long getGameId() {
return gameId;
}
public void setGameId(Long gameId) {
this.gameId = gameId;
}...
@Override
public String toString(){
return "...";
}
}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)@EnableNeo4jRepositories(value={".."})public class Neo4JConfig extends Neo4jConfiguration{
@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}
@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
apprentice321-gM/Ye1E23mwN+
2014-06-03 15:41:03 UTC
Permalink
Update:

By adding "@Transient" above the collection named "followers" makes then
Exception go away, however Object is not persistence is not permanent, e.g.
Object returned after initial save is positive however subsequent queries
for the same object returns null.
Post by apprentice321-gM/Ye1E23mwN+
I have a Jpa entity which also acts as a Neo4j cross store. Most of the
fields in the entity are saved to Mysql database except the Collection
'followers', which is stored in Neo4j. The problem is with the Collection
'followers'. it throws the exception "hibernate MappingException: Could not
determine type for: java.util.Set". A quick search yields a bunch of Jpa
Related solutions (e.g. adding onetomany annotation to the field etc) which
I assume is not relevant in this case because the collection is saved in
Neo4j not Mysql.
StacktraceCaused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
private static final long serialVersionUID = 1L;
@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch
@GraphProperty
private Set<Account> followers = new HashSet<Account>();
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name; ....
//Accessors
public Long getGameId() {
return gameId;
}
public void setGameId(Long gameId) {
this.gameId = gameId;
}...
@Override
public String toString(){
return "...";
}
}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)@EnableNeo4jRepositories(value={".."})public class Neo4JConfig extends Neo4jConfiguration{
@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}
@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
apprentice321-gM/Ye1E23mwN+
2014-06-03 16:26:58 UTC
Permalink
Update:

By adding "@Transient" above the collection name (followers) makes the
Exception go away but I don't see any references of using @Transien in the
Docs or the Manual. Now the Neo4J Property (followers) is not being saved
while JPA Properties do.
Post by apprentice321-gM/Ye1E23mwN+
I have a Jpa entity which also acts as a Neo4j cross store. Most of the
fields in the entity are saved to Mysql database except the Collection
'followers', which is stored in Neo4j. The problem is with the Collection
'followers'. it throws the exception "hibernate MappingException: Could not
determine type for: java.util.Set". A quick search yields a bunch of Jpa
Related solutions (e.g. adding onetomany annotation to the field etc) which
I assume is not relevant in this case because the collection is saved in
Neo4j not Mysql.
StacktraceCaused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
private static final long serialVersionUID = 1L;
@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch
@GraphProperty
private Set<Account> followers = new HashSet<Account>();
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name; ....
//Accessors
public Long getGameId() {
return gameId;
}
public void setGameId(Long gameId) {
this.gameId = gameId;
}...
@Override
public String toString(){
return "...";
}
}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)@EnableNeo4jRepositories(value={".."})public class Neo4JConfig extends Neo4jConfiguration{
@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}
@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
apprentice321-gM/Ye1E23mwN+
2014-06-03 16:30:40 UTC
Permalink
Update:

By adding "@Transient" above the Collection name (followers) makes the
Exception go away. Not sure i should be using @Transient becuase don't see
any references to the annotation in the Manual or Spring Neo4 Example
(@GraphProperty should be enough). Now the Neo4J Property (followers) is
not being saved while JPA Properties do.
Post by apprentice321-gM/Ye1E23mwN+
I have a Jpa entity which also acts as a Neo4j cross store. Most of the
fields in the entity are saved to Mysql database except the Collection
'followers', which is stored in Neo4j. The problem is with the Collection
'followers'. it throws the exception "hibernate MappingException: Could not
determine type for: java.util.Set". A quick search yields a bunch of Jpa
Related solutions (e.g. adding onetomany annotation to the field etc) which
I assume is not relevant in this case because the collection is saved in
Neo4j not Mysql.
StacktraceCaused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
private static final long serialVersionUID = 1L;
@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch
@GraphProperty
private Set<Account> followers = new HashSet<Account>();
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name; ....
//Accessors
public Long getGameId() {
return gameId;
}
public void setGameId(Long gameId) {
this.gameId = gameId;
}...
@Override
public String toString(){
return "...";
}
}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)@EnableNeo4jRepositories(value={".."})public class Neo4JConfig extends Neo4jConfiguration{
@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}
@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Michael Hunger
2014-06-03 16:43:51 UTC
Permalink
@Transient is added by aspectj as far as I can remember for all fields with @GraphProperty

Perhaps you miss some of the ajc config?

Michael

Sent from mobile device
Post by apprentice321-gM/Ye1E23mwN+
I have a Jpa entity which also acts as a Neo4j cross store. Most of the fields in the entity are saved to Mysql database except the Collection 'followers', which is stored in Neo4j. The problem is with the Collection 'followers'. it throws the exception "hibernate MappingException: Could not determine type for: java.util.Set". A quick search yields a bunch of Jpa Related solutions (e.g. adding onetomany annotation to the field etc) which I assume is not relevant in this case because the collection is saved in Neo4j not Mysql.
Stacktrace
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
-------
@Entity
@Table(name="game")
@NodeEntity(partial = true)
public class Game implements Serializable{
private static final long serialVersionUID = 1L;
@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch
@GraphProperty
private Set<Account> followers = new HashSet<Account>();
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name;
....
//Accessors
public Long getGameId() {
return gameId;
}
public void setGameId(Long gameId) {
this.gameId = gameId;
}
...
@Override
public String toString(){
return "...";
}
}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
@EnableNeo4jRepositories(value={".."})
public class Neo4JConfig extends Neo4jConfiguration{
@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}
@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}
}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
apprentice321-gM/Ye1E23mwN+
2014-06-03 16:59:17 UTC
Permalink
Here is my entire Jpa/Neo4J Setup. Maybe I overlooked something? In the
meantime I will remove @Transient from the collections, resort back to the
stage where I got the Exception (see initial post).

//Jpa Setup

@Configuration
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
@EnableJpaRepositories(value={"com.repository"},
entityManagerFactoryRef="entityManagerFactory",
transactionManagerRef="transactionManager")
@PropertySource("classpath:db.properties")
public class JpaConfig {
@Autowired
private Environment environment;
@Bean
public PlatformTransactionManager transactionManager() {
JpaTransactionManager txManager = new JpaTransactionManager();
txManager.setEntityManagerFactory((EntityManagerFactory)
entityManagerFactory());
return txManager;
}
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean factory = new
LocalContainerEntityManagerFactoryBean();
factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
factory.setPackagesToScan("com.equitytwits.core");
factory.setJpaPropertyMap(AppUtil.jpaProperties());
factory.setDataSource(dataSource());
return factory;
}
@Bean
public DriverManagerDataSource dataSource(){
DriverManagerDataSource driverManagerDataSource = new
DriverManagerDataSource();
driverManagerDataSource.setDriverClassName(environment.getRequiredProperty("jdbc.driverClassName"));
driverManagerDataSource.setUrl(environment.getRequiredProperty("jdbc.url"));
driverManagerDataSource.setUsername(environment.getRequiredProperty("jdbc.username"));
driverManagerDataSource.setPassword(environment.getRequiredProperty("jdbc.password"));
return driverManagerDataSource;
}
}
//Neo4j Setup
@Configuration
@ComponentScan(basePackages={"..."})
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
@EnableNeo4jRepositories(value={"..."})
public class Neo4JConfig extends Neo4jConfiguration{

@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new
SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}

@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}

@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}

}
Post by Michael Hunger
@Transient is added by aspectj as far as I can remember for all fields with @GraphProperty
Perhaps you miss some of the ajc config?
Michael
Sent from mobile device
any references to the annotation in the Manual or Spring Neo4 Example
not being saved while JPA Properties do.
Post by apprentice321-gM/Ye1E23mwN+
I have a Jpa entity which also acts as a Neo4j cross store. Most of the
fields in the entity are saved to Mysql database except the Collection
'followers', which is stored in Neo4j. The problem is with the Collection
'followers'. it throws the exception "hibernate MappingException: Could not
determine type for: java.util.Set". A quick search yields a bunch of Jpa
Related solutions (e.g. adding onetomany annotation to the field etc) which
I assume is not relevant in this case because the collection is saved in
Neo4j not Mysql.
StacktraceCaused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: game, for columns: [org.hibernate.mapping.Column(followers)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:314)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:292)
at org.hibernate.mapping.Property.isValid(Property.java:239)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1761)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
... 16 more
private static final long serialVersionUID = 1L;
@RelatedTo(type="GAME", direction=Direction.INCOMING, elementClass = Account.class)
@Fetch
@GraphProperty
private Set<Account> followers = new HashSet<Account>();
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="game_id")
private Long gameId;
@Column(name="name",unique=true)
private String name; ....
//Accessors
public Long getGameId() {
return gameId;
}
public void setGameId(Long gameId) {
this.gameId = gameId;
}...
@Override
public String toString(){
return "...";
}
}
Neo4j Config
@Configuration
@ComponentScan(basePackages={".."})@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)@EnableNeo4jRepositories(value={".."})public class Neo4JConfig extends Neo4jConfiguration{
@Bean(destroyMethod = "shutdown")
@Scope(SCOPE_PROTOTYPE)
public SpringRestGraphDatabase graphDatabaseService(){
SpringRestGraphDatabase springRestGraphDatabase = new SpringRestGraphDatabase("http://localhost:7474/db/data");
return springRestGraphDatabase;
}
@Bean
public Neo4jTemplate neo4jTemplate(){
return new Neo4jTemplate((GraphDatabase) graphDatabaseService());
}
@Bean
public Neo4jMappingContext neo4jMappingContext() {
return new Neo4jMappingContext();
}}
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Loading...