Closed compensator closed 9 years ago
@lvca Any word on this one? I regenerated the graph without the UUID in the class name, but it still returns a null for @class in the above stated SELECT statement.
@compensator I have a question why: select firstName from Person
would return @class
in any case? firstName is only a string..
The problem arose from a different direction. I attempted to create an index on firstName and the database stated that Person doesn't have a "firstName" field. Since I see @class and class when I execute a "select *", I decided to execute "select firstName". The output in the console shows "null" for @class in the output along with the rid (without the cluster id). I can't answer for why Orient decided to have the database return "rid, @class, property/field value", but they do, and it gave me a clue. I'd read two weeks ago that Tinkerpop Frames interfacing with OrientDB doesn't result in proper management of classes: https://groups.google.com/forum/#!topic/orient-database/FMAb4sxnA_U
Since submitting this Issue, I recreated the database and reloaded data where UUID is not appended as such: java ftg.addVertex("class:Person", Person.class);
I still get:
com.orientechnologies.orient.core.index.OIndexException: Index with name : 'Person.firstName' cannot be created on class : 'Person' because field: 'firstName' is absent in class definition. ```
@compensator it is not very clear to me but fields and properties are different. It could be that you need to have those in your schema.. do you have them there? It could be that schema has properties so you can just ignore what I said..
I'm evaluating and learning the product under a tight timeline, so at times, I throw in a test of a feature while waiting on a test to complete. I therefore attempted this without thorough reading. I just reviewed the documentation again and tested the following command:
CREATE INDEX PersonIndex ON Person (firstName, middleName, lastName, dob) FULLTEXT METADATA {ignoreNullValues : false}
I still receive the Exception stating that the field doesn't exist. It is my current belief that since I created the objects using Tinkerpop Frames, OrientDB is not adding the Interface properties to the schema at the time of creation. It would make sense that it adds the properties to the schema given the @Property annotation, but apparently not.
CREATE INDEX <name> [ON <class-name> (prop-names)] <type> [<key-type>]
METADATA [{<json-metadata>}]
Where:
<class>.<property>
to create an automatic index bound to a schema property. In this case class is the class of the schema and property, is the property created into the class. Notice that in another case index name can't contain '.' symbolIf "ON" and key-type sections both exist database validate types of specified properties. And if types of properties not equals to types specified in key-type list, exception will be thrown.
List of key types can be used for creation manual composite indexes, but such indexes don't have fully support yet.
CREATE INDEX mostRecentRecords unique date
CREATE PROPERTY User.id BINARY
CREATE INDEX User.id UNIQUE
CREATE INDEX thumbsAuthor ON Movie (thumbs) UNIQUE;
CREATE INDEX thumbsAuthor ON Movie (thumbs BY KEY) UNIQUE;
CREATE INDEX thumbsValue ON Movie (thumbs BY VALUE) UNIQUE;
CREATE PROPERTY Book.author STRING
CREATE PROPERTY Book.title STRING
CREATE PROPERTY Book.publicationYears EMBEDDEDLIST INTEGER
CREATE INDEX books ON Book (author, title, publicationYears) UNIQUE
@compensator As fa as I know this isn't supported. Even if it's straightforward, the synch of properties is still an open issue.
Yes. I'll likely be implementing a reflection-based solution.
Example Person object
Select * from Person shows @class is Person.
Select firstName from Person shows @class is null.
CREATE INDEX Person.firstName throws the following Exception:
com.orientechnologies.orient.core.index.OIndexException: Index with name : 'Person.firstName' cannot be created on class : 'Person' because field: 'firstName' is absent in class definition.
Is this a bug or because of the recommendation to add UUID to the addVertex method call?