I tried dropping the property before adding it again as a link, it was fine 
on DB level I could find it created as required but when populating the 
data it shows the season for all Competition records like "#55:-50 
<http://localhost:2480/studio/index.html#/database/sport/browse/edit/55:-50>" 
which is a dummy record "not found".
Through the documentation it mentions this to have a link created in the 
record. But in my case it is so much java process to go through all classes 
and properties to fill their values this way. In 1.7.10 version that was 
done automatically. 
1-1 and N-1 embedded relationships

1-1 and N-1 embedded relationships are expressed using the *EMBEDDED* type.

OClass address = database.getMetadata().getSchema().createClass("Address");

OClass account = database.getMetadata().getSchema().createClass("Account");
account.createProperty("id", OType.INTEGER);
account.createProperty("birthDate", OType.DATE);
account.createProperty("address", OType.EMBEDDED, address);



On Tuesday, January 27, 2015 at 8:51:31 PM UTC+4, Lvc@ wrote:
>
> On 27 January 2015 at 17:11, Kareem Jabr <karee...@gmail.com <javascript:>
> > wrote:
>
>> I tried the following:
>> db.command(new OCommandSQL("create property Competition.season LINK 
>> Season")).execute();
>>
>> but i got this exception since I am 
>> calling: 
>> db.getEntityManager().registerEntityClasses("com.sport.server.model"); 
>> before
>>
>> com.orientechnologies.orient.core.exception.OCommandExecutionException: 
>> Property 'Competition.season' already exists. Remove it before to retry.
>>
>>
> Ok, drop it and recreate it. To drop the property:
>
> *DROP PROPERTY Competition.season*
>  
>
>>
>> Where can I open a new issue? Github?
>>
>
> https://github.com/orientechnologies/orientdb/issues
>
>  
>
>>
>>
>>
>> On Tuesday, January 27, 2015 at 7:58:07 PM UTC+4, Lvc@ wrote:
>>>
>>> Hi Kareem,
>>> Unfortunately no. But you could open a new issue on that.
>>>
>>> Lvc@
>>>
>>> On 27 January 2015 at 16:52, Kareem Jabr <karee...@gmail.com> wrote:
>>>
>>>> Thanks Lvc@ for your reply. Is there an automated way like an 
>>>> annotation to do this when creating the schema from java side!? Because I 
>>>> have so many POJOS in my project.
>>>>
>>>> On Tuesday, January 27, 2015 at 7:39:40 PM UTC+4, Lvc@ wrote:
>>>>>
>>>>> Try forcing that property to be LINK instead of embedded:
>>>>>
>>>>>
>>>>> *create property Account.person LINK Person*
>>>>> Lvc@
>>>>>
>>>>>
>>>>> On 27 January 2015 at 16:16, Kareem Jabr <karee...@gmail.com> wrote:
>>>>>
>>>>>> I found a workaround for this which is using the api of 1.7.10 with 
>>>>>> DB 2.0, this issue is solved as in the maven dependency below:
>>>>>> But I would like to know how to do the same job with 2.0 API:
>>>>>>
>>>>>> <dependency>
>>>>>> <groupId>com.orientechnologies</groupId>
>>>>>> <artifactId>orientdb-enterprise</artifactId>
>>>>>> <!-- <version>2.0</version> -->
>>>>>> <version>1.7.10</version>
>>>>>> </dependency> 
>>>>>> <dependency>
>>>>>> <groupId>com.orientechnologies</groupId>
>>>>>> <artifactId>orientdb-client</artifactId>
>>>>>> <!-- <version>2.0</version> -->
>>>>>> <version>1.7.10</version>
>>>>>> </dependency>
>>>>>> <dependency>
>>>>>> <groupId>com.orientechnologies</groupId>
>>>>>> <artifactId>orientdb-core</artifactId>
>>>>>> <!-- <version>2.0</version> -->
>>>>>> <version>1.7.10</version>
>>>>>> </dependency> 
>>>>>> <dependency>
>>>>>> <groupId>com.orientechnologies</groupId>
>>>>>> <artifactId>orientdb-object</artifactId>
>>>>>> <!-- <version>2.0</version> -->
>>>>>> <version>1.7.10</version>
>>>>>> </dependency>
>>>>>> <dependency>
>>>>>> <groupId>com.orientechnologies</groupId>
>>>>>> <artifactId>orient-commons</artifactId>
>>>>>> <!-- <version>2.0-M1</version> -->
>>>>>> <version>1.7.10</version>
>>>>>> </dependency>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>  -- 
>>>>>>
>>>>>> --- 
>>>>>> 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 orient-databa...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>  -- 
>>>>
>>>> --- 
>>>> 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 orient-databa...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>>
>> --- 
>> 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 orient-databa...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to