Re: MS SQL Server: Select Distinct on text datatype

2008-08-06 Thread Andrus Adamchik
On Aug 5, 2008, at 9:55 PM, Lachlan Deck wrote: Are you +1 on providing these with accessors? Actually no, as there is lots of private state there. I want to hide as much as possible. I think we are exposing too much stuff at this level already. If you have a specific adapter customizatio

Re: MS SQL Server: Select Distinct on text datatype

2008-08-06 Thread Lachlan Deck
On 06/08/2008, at 11:32 AM, Andrus Adamchik wrote: On Aug 5, 2008, at 9:24 PM, Lachlan Deck wrote: Was just thinking that there didn't seem to be any hook available to createSqlString() (which calls the above method) to ensure suppressingDistinct is true for this case. Sure. I am +1 on su

Re: MS SQL Server: Select Distinct on text datatype

2008-08-05 Thread Andrus Adamchik
On Aug 5, 2008, at 9:24 PM, Lachlan Deck wrote: Was just thinking that there didn't seem to be any hook available to createSqlString() (which calls the above method) to ensure suppressingDistinct is true for this case. Sure. I am +1 on such change if we find that overriding it in a subcl

Re: MS SQL Server: Select Distinct on text datatype

2008-08-05 Thread Lachlan Deck
On 06/08/2008, at 10:40 AM, Andrus Adamchik wrote: On Aug 5, 2008, at 8:27 PM, Lachlan Deck wrote: Any objections to adding (or making) isUnsupportedForDistinct non- static? i.e., assuming that SelectTranslator can be overridden. I don't have any objections per se, but can you elaborate how

Re: MS SQL Server: Select Distinct on text datatype

2008-08-05 Thread Andrus Adamchik
On Aug 5, 2008, at 8:27 PM, Lachlan Deck wrote: Any objections to adding (or making) isUnsupportedForDistinct non- static? i.e., assuming that SelectTranslator can be overridden. I don't have any objections per se, but can you elaborate how that can help in your situation? Andrus

Re: MS SQL Server: Select Distinct on text datatype

2008-08-05 Thread Lachlan Deck
Hi there, On 05/08/2008, at 6:49 AM, Andrus Adamchik wrote: Andrey, you are spot on with the UNSUPPORTED_DISTINCT_TYPES. Any objections to adding (or making) isUnsupportedForDistinct non- static? i.e., assuming that SelectTranslator can be overridden. Here is one caveat (and hopefully a wo

Re: MS SQL Server: Select Distinct on text datatype

2008-08-05 Thread Andrus Adamchik
Hi Matthias, maybe you can switch to CLOB column type on Derby. Andrus On Aug 4, 2008, at 9:39 PM, Matthias Moeser wrote: Hi! Thank you Andrus and Andrey. I changed the mapping for the columns of datatype "text" from VARCHAR to CLOB (max length 32000) in Cayenne Modeler. Everything is wo

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Matthias Moeser
Hi! Thank you Andrus and Andrey. I changed the mapping for the columns of datatype "text" from VARCHAR to CLOB (max length 32000) in Cayenne Modeler. Everything is working fine now for MS SQL server. But I also run the applicaion with embedded Derby, where I use VARCHAR (32000) in the sql

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Lachlan Deck
On 05/08/2008, at 6:49 AM, Andrus Adamchik wrote: Andrey, you are spot on with the UNSUPPORTED_DISTINCT_TYPES. Here is one caveat (and hopefully a workaround). "text" is a SQL Server native type; UNSUPPORTED_DISTINCT_TYPES stores abstract JDBC types. So I think Matthias can simply map his "

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Andrus Adamchik
Andrey, you are spot on with the UNSUPPORTED_DISTINCT_TYPES. Here is one caveat (and hopefully a workaround). "text" is a SQL Server native type; UNSUPPORTED_DISTINCT_TYPES stores abstract JDBC types. So I think Matthias can simply map his "text" column as a CLOB in Cayenne, and Cayenne wil

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Andrey Razumovsky
I've looked at the code a bit. Turns out there're some UNSUPPORTED_DISTINCT_TYPES in SelectTranslator class. Probably if "text" type will be added there, this would let go the exceptions. I'll advice to open a JIRA issue about it. By now you could try use SQLTemplate. It will not generate any "dist

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Matthias Moeser
Hi, On 04/08/2008, at 5:49 PM, Lachlan Deck wrote: On 04/08/2008, at 5:39 PM, Andrey Razumovsky wrote: This is definitely MS SQL's issue, not Cayenne's. Only thing I can recommend, if you can allow that, select all rows and then seed out duplicate rows manually AFAIK we are not purposely tu

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Lachlan Deck
Hi there, On 04/08/2008, at 5:39 PM, Andrey Razumovsky wrote: This is definitely MS SQL's issue, not Cayenne's. Only thing I can recommend, if you can allow that, select all rows and then seed out duplicate rows manually AFAIK we are not purposely turning on the flag for obtaining distinct

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Andrey Razumovsky
This is definitely MS SQL's issue, not Cayenne's. Only thing I can recommend, if you can allow that, select all rows and then seed out duplicate rows manually 2008/8/4, Matthias Moeser <[EMAIL PROTECTED]>: > > Hi! > > We are using Cayenne with Microsoft SQL Server. We get a > com.microsoft.sqlserv

MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Matthias Moeser
Hi! We are using Cayenne with Microsoft SQL Server. We get a com.microsoft.sqlserver.jdbc.SQLServerException: "The text data type cannot be selected as DISTINCT because it is not comparable." The problem is that the following query is not allowed in MS SQL Server: SELECT DISTINCT column FR