You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Kevin Meyer - KMZ <ke...@kmz.co.za> on 2011/12/14 06:31:09 UTC
Table case in CreateIfNoSchemaStrategy causes problems [3.1M4-SNAPSHOT]
In CreateIfNoSchemaStrategy, I have run into problems with HSQLDB
and upper/mixed case table names.
In particular, if I lower or mixed case my DBEntity name, the resulting
tables are not found by CreateIfNoSchemaStrategy whenI use
HSQLDB.
I found that if I convert all table name checks to upper case, then
CreateIfNoSchemaStrategy finds the existing table and does not try to
regenerate it.
Is this a general solution? Will it break anything else? Should I raise a
JIRA ticket?
Regards,
Kevin
while (it.hasNext()) {
if (nameTables.get(it.next().getName().toUpperCase()) != null) {
generate = false;
break;
}
}
and
while (rs.next()) {
String name = rs.getString("TABLE_NAME");
nameTables.put(name.toUpperCase(), false);
}
Re: Table case in CreateIfNoSchemaStrategy causes problems [3.1M4-SNAPSHOT]
Posted by Michael Gentry <mg...@masslight.net>.
Thanks Kevin!
On Thu, Dec 15, 2011 at 9:37 AM, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:
> By default HSQLDB converts all table names and field names to upper
> case, and is case sensitive on SELECTS.
>
> I've created JIRA CAY-1645. I'm not sure about which component or
> type, so I chose Task and left the component blank.
>
> Regards,
> Kevin
>
>
> On 15 Dec 2011 at 8:56, Michael Gentry wrote:
>
>> Hi Kevin,
>>
>> I'm not familiar offhand with the case sensitivity of HSQLDB, but a
>> JIRA would be nice so we can remember to explore it later.
>>
>> Thanks,
>>
>> mrg
>>
>>
>> On Wed, Dec 14, 2011 at 12:31 AM, Kevin Meyer - KMZ wrote:
>> > In CreateIfNoSchemaStrategy, I have run into problems with HSQLDB
>> > and upper/mixed case table names.
>> >
>> > In particular, if I lower or mixed case my DBEntity name, the resulting
>> > tables are not found by CreateIfNoSchemaStrategy whenI use
>> > HSQLDB.
>> >
>> > I found that if I convert all table name checks to upper case, then
>> > CreateIfNoSchemaStrategy finds the existing table and does not try to
>> > regenerate it.
>> >
>> > Is this a general solution? Will it break anything else? Should I raise a
>> > JIRA ticket?
>> >
>> > Regards,
>> > Kevin
>> >
>> > while (it.hasNext()) {
>> > if (nameTables.get(it.next().getName().toUpperCase()) != null) {
>> > generate = false;
>> > break;
>> > }
>> > }
>> >
>> >
>> > and
>> >
>> > while (rs.next()) {
>> > String name = rs.getString("TABLE_NAME");
>> > nameTables.put(name.toUpperCase(), false);
>> > }
>> >
>
Re: Table case in CreateIfNoSchemaStrategy causes problems [3.1M4-SNAPSHOT]
Posted by Andrus Adamchik <an...@objectstyle.org>.
Maybe try DataMap.setQuotingSQLIdentifiers(true) - this should ensure case sensitive operation of the strategy IIRC.
Cheers,
Andrus
On Dec 15, 2011, at 9:37 AM, Kevin Meyer - KMZ wrote:
> By default HSQLDB converts all table names and field names to upper
> case, and is case sensitive on SELECTS.
>
> I've created JIRA CAY-1645. I'm not sure about which component or
> type, so I chose Task and left the component blank.
>
> Regards,
> Kevin
>
>
> On 15 Dec 2011 at 8:56, Michael Gentry wrote:
>
>> Hi Kevin,
>>
>> I'm not familiar offhand with the case sensitivity of HSQLDB, but a
>> JIRA would be nice so we can remember to explore it later.
>>
>> Thanks,
>>
>> mrg
>>
>>
>> On Wed, Dec 14, 2011 at 12:31 AM, Kevin Meyer - KMZ wrote:
>>> In CreateIfNoSchemaStrategy, I have run into problems with HSQLDB
>>> and upper/mixed case table names.
>>>
>>> In particular, if I lower or mixed case my DBEntity name, the resulting
>>> tables are not found by CreateIfNoSchemaStrategy whenI use
>>> HSQLDB.
>>>
>>> I found that if I convert all table name checks to upper case, then
>>> CreateIfNoSchemaStrategy finds the existing table and does not try to
>>> regenerate it.
>>>
>>> Is this a general solution? Will it break anything else? Should I raise a
>>> JIRA ticket?
>>>
>>> Regards,
>>> Kevin
>>>
>>> while (it.hasNext()) {
>>> if (nameTables.get(it.next().getName().toUpperCase()) != null) {
>>> generate = false;
>>> break;
>>> }
>>> }
>>>
>>>
>>> and
>>>
>>> while (rs.next()) {
>>> String name = rs.getString("TABLE_NAME");
>>> nameTables.put(name.toUpperCase(), false);
>>> }
>>>
>
>
Re: Table case in CreateIfNoSchemaStrategy causes problems [3.1M4-SNAPSHOT]
Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
By default HSQLDB converts all table names and field names to upper
case, and is case sensitive on SELECTS.
I've created JIRA CAY-1645. I'm not sure about which component or
type, so I chose Task and left the component blank.
Regards,
Kevin
On 15 Dec 2011 at 8:56, Michael Gentry wrote:
> Hi Kevin,
>
> I'm not familiar offhand with the case sensitivity of HSQLDB, but a
> JIRA would be nice so we can remember to explore it later.
>
> Thanks,
>
> mrg
>
>
> On Wed, Dec 14, 2011 at 12:31 AM, Kevin Meyer - KMZ wrote:
> > In CreateIfNoSchemaStrategy, I have run into problems with HSQLDB
> > and upper/mixed case table names.
> >
> > In particular, if I lower or mixed case my DBEntity name, the resulting
> > tables are not found by CreateIfNoSchemaStrategy whenI use
> > HSQLDB.
> >
> > I found that if I convert all table name checks to upper case, then
> > CreateIfNoSchemaStrategy finds the existing table and does not try to
> > regenerate it.
> >
> > Is this a general solution? Will it break anything else? Should I raise a
> > JIRA ticket?
> >
> > Regards,
> > Kevin
> >
> > while (it.hasNext()) {
> > if (nameTables.get(it.next().getName().toUpperCase()) != null) {
> > generate = false;
> > break;
> > }
> > }
> >
> >
> > and
> >
> > while (rs.next()) {
> > String name = rs.getString("TABLE_NAME");
> > nameTables.put(name.toUpperCase(), false);
> > }
> >
Re: Table case in CreateIfNoSchemaStrategy causes problems [3.1M4-SNAPSHOT]
Posted by Michael Gentry <mg...@masslight.net>.
Hi Kevin,
I'm not familiar offhand with the case sensitivity of HSQLDB, but a
JIRA would be nice so we can remember to explore it later.
Thanks,
mrg
On Wed, Dec 14, 2011 at 12:31 AM, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:
> In CreateIfNoSchemaStrategy, I have run into problems with HSQLDB
> and upper/mixed case table names.
>
> In particular, if I lower or mixed case my DBEntity name, the resulting
> tables are not found by CreateIfNoSchemaStrategy whenI use
> HSQLDB.
>
> I found that if I convert all table name checks to upper case, then
> CreateIfNoSchemaStrategy finds the existing table and does not try to
> regenerate it.
>
> Is this a general solution? Will it break anything else? Should I raise a
> JIRA ticket?
>
> Regards,
> Kevin
>
> while (it.hasNext()) {
> if (nameTables.get(it.next().getName().toUpperCase()) != null) {
> generate = false;
> break;
> }
> }
>
>
> and
>
> while (rs.next()) {
> String name = rs.getString("TABLE_NAME");
> nameTables.put(name.toUpperCase(), false);
> }
>