java - OrientDB Select name of an an object followed by more than 2 users -
java - OrientDB Select name of an an object followed by more than 2 users -
i have 2 classes :
public interface persona { @property("name") public void setname(string name); @property("name") public string getname(); @property("surname") public void setsurname(string surname); @property("surname") public int getsurname(); @property("age") public void setage(int age); @property("age") public int getage(); } and
public interface vettura { @property("name") public void setname(string name); @property("name") public string getname(); @property("model") public void setmodel(string model); @property("model") public int getmodel(); @adjacency(label = "follower", direction = direction.in) public iterable<persona> getfollowers(); @adjacency(label = "follower",direction = direction.in) public void addfollower(persona person); } i trying (without success) write query display object "vettura" if followers more 2.
how can write it?
i wrote 1 give me objects without filter want :
for (vertex v : (iterable<vertex>) graph.command( new ocommandsql(" select name vettura vettura.in('follower').count > 1 in vettura.in('follower') ")).execute()) { system.out.println("- vettura: " + v.getvertices(direction.both, "name")); } thanks in advance , attention.
stefano
try one:
select vettura ine('follower').size() > 1; java sql count vertex orientdb
Comments
Post a Comment