I am trying to use ferma ORM for my project . Current problem is, I am not able to persist my entities to JanusGraph DB.
Here is my code Required :
Entity Class
public abstract class Person extends AbstractVertexFrame {
private String id;
private String name;
private int age;
private String mobile;
@Property("age")
public abstract int getAge();
@Property("age")
public abstract void setAge(int age) ;
@Property("mobile")
public abstract String getMobile();
@Property("mobile")
public abstract void setMobile(String mobile) ;
public String getId() {
return id;
}
@Property("name")
public abstract String getName() ;
@Property("name")
public abstract void setName(String name);
public String toString(){
return this.name+" has Id"+this.getId();
}
}
This is how I create/initialize my DelegatedFramedGraph bean:
@Bean
FramedGraph framedGraph(JanusGraph graph,GremlinBeanPostProcessor gremlinBeanPostProcessor){
return new DelegatingFramedGraph(graph,true,gremlinBeanPostProcessor.getEntityClasses());
}
JanusGraph is initialized :
@Bean
JanusGraph graph(JanusGremlinGraphFactory janusGremlinGraphFactory){
JanusGraph janusGraph = null;
janusGraph = janusGremlinGraphFactory.openGraph();
return janusGraph;
}
@Bean
JanusGremlinGraphFactory janusGremlinGraphFactory(){
JanusGremlinGraphFactory jggf;
jggf = new JanusGremlinGraphFactory();
jggf.setConfiguration(getConfiguration());
return jggf;
}
When I try to persist it:
@Autowired
private FramedGraph framedGraph;
public String savePerson(String name,int age,String mobile){
Person person = framedGraph.addFramedVertex(Person.class);
person.setName(name);
person.setAge(age);
person.setMobile(mobile);
System.out.println(person.getName()+"and person id is"+person.getId());
return person.toString();
}
Nothing is stored to JanusGraph, not sure where is the problem.
Can somebody help me ?
I am trying to use ferma ORM for my project . Current problem is, I am not able to persist my entities to JanusGraph DB.
Here is my code Required :
Entity Class
This is how I create/initialize my DelegatedFramedGraph bean:
JanusGraph is initialized :
When I try to persist it:
Nothing is stored to JanusGraph, not sure where is the problem.
Can somebody help me ?