Hi, I can't decide if I found a bug. When I change the collate for a field,
also the fields with the same name of the super-classes change collate. I
understood that for a hierarchy of classes the field is the same, but this
behaviour seems to me a bit unexpected.
In attachment you'll find the test-case.
Cheers,
Riccardo
2014-04-14 9:23 GMT+02:00 Riccardo Tasso <[email protected]>:
>
> 2014-04-14 9:15 GMT+02:00 Riccardo Tasso <[email protected]>:
>
> Thanks, can I do it with a console command?
>
>
> Yes, it is done by:
>
> ALTER PROPERTY MyClass.my_property COLLATE ci
>
> Thanks for the suggesion, it seems to work.
>
> Riccardo
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
package it.celi.orient.bug;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import com.orientechnologies.orient.core.metadata.schema.OProperty;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx;
import com.tinkerpop.blueprints.impls.orient.OrientVertexType;
import com.tinkerpop.blueprints.impls.orient.OrientVertexType.OrientVertexProperty;
public class HierarchicalCollateOrientTest {
@Test
public void test() {
OrientGraphFactory factory = new OrientGraphFactory("memory:temp");
OrientGraphNoTx graph = factory.getNoTx();
OrientVertexType mySuperClass = graph.createVertexType("MySuperClass");
OrientVertexProperty myProperty = mySuperClass.createProperty("myProperty", OType.STRING);
assertNotNull(myProperty);
assertEquals("default", myProperty.getCollate().getName());
OrientVertexType mySubClass = graph.createVertexType("MySubClass", mySuperClass);
OProperty mySubProperty = mySubClass.getProperty("myProperty");
assertNotNull(mySubProperty);
mySubProperty.setCollate("ci");
assertEquals("ci", mySubProperty.getCollate().getName());
assertEquals("default", myProperty.getCollate().getName());
}
}