You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Christian Grobmeier <gr...@gmail.com> on 2011/02/16 12:40:51 UTC

Unique Indexes with the modeller

Hello,

how can I create a unique index on a column with the modeller?
Couldn't find any information even with google :-)

I also could not find any info about indexing in Cayenne in general...
my tables are all without an index (except my primary key, which is
indexed by default).

I am using Cay 3.1 + MySQL

Thanks
Christian

-- 
http://www.grobmeier.de

Re: Unique Indexes with the modeller

Posted by Andrus Adamchik <an...@objectstyle.org>.
See my other email on the philosophy behind it.

On Feb 16, 2011, at 2:10 PM, Christian Grobmeier wrote:

> On Wed, Feb 16, 2011 at 1:04 PM, Andrey Razumovsky
> <ra...@gmail.com> wrote:
>> It's not supported by Cayenne, though it's a long-standing request. If
>> you're willing to watch or contribute, you can follow
>> https://issues.apache.org/jira/browse/CAY-204
> 
> I am watching now.
> 
> I am bit curious... this feature seems very important to me. Compared
> to all the other great stuff in Cay, I wonder why this is still
> undone. It seems not to complex - adding it to the xml, interpreting
> it from the dialects. Is this correct? Or are there any heavy hurdles
> to be taken?
> 
> Cheers
> 
> 
> 
>> 
>> 2011/2/16 Marek Šabo <ms...@buk.cvut.cz>:
>>> Actually I would like to know whether there is any support for this in cm
>>> because I've been appending them manually in generated schemata.
>>> 
>>> On 02/16/2011 12:40 PM, Christian Grobmeier wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> how can I create a unique index on a column with the modeller?
>>>> Couldn't find any information even with google :-)
>>>> 
>>>> I also could not find any info about indexing in Cayenne in general...
>>>> my tables are all without an index (except my primary key, which is
>>>> indexed by default).
>>>> 
>>>> I am using Cay 3.1 + MySQL
>>>> 
>>>> Thanks
>>>> Christian
>>>> 
>>> 
>>> --
>>> Marek Šabo
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Andrey
>> 
> 
> 
> 
> -- 
> http://www.grobmeier.de
> 


Re: Unique Indexes with the modeller

Posted by Christian Grobmeier <gr...@gmail.com>.
On Wed, Feb 16, 2011 at 1:04 PM, Andrey Razumovsky
<ra...@gmail.com> wrote:
> It's not supported by Cayenne, though it's a long-standing request. If
> you're willing to watch or contribute, you can follow
> https://issues.apache.org/jira/browse/CAY-204

I am watching now.

I am bit curious... this feature seems very important to me. Compared
to all the other great stuff in Cay, I wonder why this is still
undone. It seems not to complex - adding it to the xml, interpreting
it from the dialects. Is this correct? Or are there any heavy hurdles
to be taken?

Cheers



>
> 2011/2/16 Marek Šabo <ms...@buk.cvut.cz>:
>> Actually I would like to know whether there is any support for this in cm
>> because I've been appending them manually in generated schemata.
>>
>> On 02/16/2011 12:40 PM, Christian Grobmeier wrote:
>>>
>>> Hello,
>>>
>>> how can I create a unique index on a column with the modeller?
>>> Couldn't find any information even with google :-)
>>>
>>> I also could not find any info about indexing in Cayenne in general...
>>> my tables are all without an index (except my primary key, which is
>>> indexed by default).
>>>
>>> I am using Cay 3.1 + MySQL
>>>
>>> Thanks
>>> Christian
>>>
>>
>> --
>> Marek Šabo
>>
>>
>
>
>
> --
> Andrey
>



-- 
http://www.grobmeier.de

Re: Unique Indexes with the modeller

Posted by Marcin Skladaniec <ma...@ish.com.au>.
This is my thinking as well.
Indeed I have unique indexes defined on the database level. After 
reading this thread it seems like I need to remove them until cayenne 
adds support for it.

Thanks.
Marcin

On 17/02/11 12:11 AM, Michael Gentry wrote:
> I think this discussion kind of ties into Marcin's question yesterday
> (which I haven't had a chance to thoroughly read his latest reply).  I
> believe Marcin's problem is the unique index was defined outside the
> model and Cayenne doesn't know that it needs to do a delete before an
> insert on the record he is having problems with.  If the unique index
> information was kept in the modeler, that could potentially help order
> operations better.
>
> Just guessing.  :-)
>
> Thanks,
>
> mrg
>
>
> On Wed, Feb 16, 2011 at 7:27 AM, Andrus Adamchik<an...@objectstyle.org>  wrote:
>> On Feb 16, 2011, at 2:20 PM, Christian Grobmeier wrote:
>>
>>> I am very +1 on adding this feature to the modeller. Even when it may
>>> go further to standard ORM, the modeller cannot be used alone for
>>> working with cayenne. On the other hand there is no chance to prevent
>>> the loss of indexes when the db schema is regenerated.
>> A "complete" implementation would probably store index definitions in Cayenne .map.xml. So on Cayenne end they become first class citizens, just like tables, PKs, etc. And when DB generation is done from the Modeler they will also be generated.
>>
>> Andrus
>>
>>


Re: Unique Indexes with the modeller

Posted by Michael Gentry <mg...@masslight.net>.
I think this discussion kind of ties into Marcin's question yesterday
(which I haven't had a chance to thoroughly read his latest reply).  I
believe Marcin's problem is the unique index was defined outside the
model and Cayenne doesn't know that it needs to do a delete before an
insert on the record he is having problems with.  If the unique index
information was kept in the modeler, that could potentially help order
operations better.

Just guessing.  :-)

Thanks,

mrg


On Wed, Feb 16, 2011 at 7:27 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>
> On Feb 16, 2011, at 2:20 PM, Christian Grobmeier wrote:
>
>> I am very +1 on adding this feature to the modeller. Even when it may
>> go further to standard ORM, the modeller cannot be used alone for
>> working with cayenne. On the other hand there is no chance to prevent
>> the loss of indexes when the db schema is regenerated.
>
> A "complete" implementation would probably store index definitions in Cayenne .map.xml. So on Cayenne end they become first class citizens, just like tables, PKs, etc. And when DB generation is done from the Modeler they will also be generated.
>
> Andrus
>
>

Re: Unique Indexes with the modeller

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Feb 16, 2011, at 2:20 PM, Christian Grobmeier wrote:

> I am very +1 on adding this feature to the modeller. Even when it may
> go further to standard ORM, the modeller cannot be used alone for
> working with cayenne. On the other hand there is no chance to prevent
> the loss of indexes when the db schema is regenerated.

A "complete" implementation would probably store index definitions in Cayenne .map.xml. So on Cayenne end they become first class citizens, just like tables, PKs, etc. And when DB generation is done from the Modeler they will also be generated.

Andrus


Re: Unique Indexes with the modeller

Posted by Christian Grobmeier <gr...@gmail.com>.
> Also note that the underlying argument about this feature is whether CayenneModeler (and consequently map.xml) should include general DB admin functions not relevant to the ORM. Even though back in 2005 I said "I am for adding more DB admin functions to the Modeler", I am still on the fence on whether it is a good idea. In this particular case I guess I won't object to a working implementation.

I am very +1 on adding this feature to the modeller. Even when it may
go further to standard ORM, the modeller cannot be used alone for
working with cayenne. On the other hand there is no chance to prevent
the loss of indexes when the db schema is regenerated.

Imho I would stop when it comes to adding users to a database or
re-enter passwords or something like that.

Thanks for the explaination anyway


>
> Andrus
>
> On Feb 16, 2011, at 2:04 PM, Andrey Razumovsky wrote:
>
>> It's not supported by Cayenne, though it's a long-standing request. If
>> you're willing to watch or contribute, you can follow
>> https://issues.apache.org/jira/browse/CAY-204
>>
>> 2011/2/16 Marek Šabo <ms...@buk.cvut.cz>:
>>> Actually I would like to know whether there is any support for this in cm
>>> because I've been appending them manually in generated schemata.
>>>
>>> On 02/16/2011 12:40 PM, Christian Grobmeier wrote:
>>>>
>>>> Hello,
>>>>
>>>> how can I create a unique index on a column with the modeller?
>>>> Couldn't find any information even with google :-)
>>>>
>>>> I also could not find any info about indexing in Cayenne in general...
>>>> my tables are all without an index (except my primary key, which is
>>>> indexed by default).
>>>>
>>>> I am using Cay 3.1 + MySQL
>>>>
>>>> Thanks
>>>> Christian
>>>>
>>>
>>> --
>>> Marek Šabo
>>>
>>>
>>
>>
>>
>> --
>> Andrey
>>
>
>



-- 
http://www.grobmeier.de

Re: Unique Indexes with the modeller

Posted by Andrus Adamchik <an...@objectstyle.org>.
Also note that the underlying argument about this feature is whether CayenneModeler (and consequently map.xml) should include general DB admin functions not relevant to the ORM. Even though back in 2005 I said "I am for adding more DB admin functions to the Modeler", I am still on the fence on whether it is a good idea. In this particular case I guess I won't object to a working implementation.

Andrus

On Feb 16, 2011, at 2:04 PM, Andrey Razumovsky wrote:

> It's not supported by Cayenne, though it's a long-standing request. If
> you're willing to watch or contribute, you can follow
> https://issues.apache.org/jira/browse/CAY-204
> 
> 2011/2/16 Marek Šabo <ms...@buk.cvut.cz>:
>> Actually I would like to know whether there is any support for this in cm
>> because I've been appending them manually in generated schemata.
>> 
>> On 02/16/2011 12:40 PM, Christian Grobmeier wrote:
>>> 
>>> Hello,
>>> 
>>> how can I create a unique index on a column with the modeller?
>>> Couldn't find any information even with google :-)
>>> 
>>> I also could not find any info about indexing in Cayenne in general...
>>> my tables are all without an index (except my primary key, which is
>>> indexed by default).
>>> 
>>> I am using Cay 3.1 + MySQL
>>> 
>>> Thanks
>>> Christian
>>> 
>> 
>> --
>> Marek Šabo
>> 
>> 
> 
> 
> 
> -- 
> Andrey
> 


Re: Unique Indexes with the modeller

Posted by Andrey Razumovsky <ra...@gmail.com>.
It's not supported by Cayenne, though it's a long-standing request. If
you're willing to watch or contribute, you can follow
https://issues.apache.org/jira/browse/CAY-204

2011/2/16 Marek Šabo <ms...@buk.cvut.cz>:
> Actually I would like to know whether there is any support for this in cm
> because I've been appending them manually in generated schemata.
>
> On 02/16/2011 12:40 PM, Christian Grobmeier wrote:
>>
>> Hello,
>>
>> how can I create a unique index on a column with the modeller?
>> Couldn't find any information even with google :-)
>>
>> I also could not find any info about indexing in Cayenne in general...
>> my tables are all without an index (except my primary key, which is
>> indexed by default).
>>
>> I am using Cay 3.1 + MySQL
>>
>> Thanks
>> Christian
>>
>
> --
> Marek Šabo
>
>



-- 
Andrey

Re: Unique Indexes with the modeller

Posted by Marek Šabo <ms...@buk.cvut.cz>.
Actually I would like to know whether there is any support for this in 
cm because I've been appending them manually in generated schemata.

On 02/16/2011 12:40 PM, Christian Grobmeier wrote:
> Hello,
>
> how can I create a unique index on a column with the modeller?
> Couldn't find any information even with google :-)
>
> I also could not find any info about indexing in Cayenne in general...
> my tables are all without an index (except my primary key, which is
> indexed by default).
>
> I am using Cay 3.1 + MySQL
>
> Thanks
> Christian
>

-- 
Marek Šabo