[ 
https://issues.apache.org/jira/browse/CAY-2639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrus Adamchik updated CAY-2639:
---------------------------------
    Description: 
I just ran into a minor issue with DB import Modeler process. 

Given: A table with lowercase table name and uppercase column names 

1. DB Import the table to Cayenne. Import preserves correct capitalization. 
2. Due to a change in project naming conventions, column name capitalization 
was changed to lowercase.
3. Rerun DB import.. Result: no changes were reported, and I had to adjust the 
model by hand.

So DB Import is CS for new names, but is CI when checking for changes. 

The topic of case sensitivity of DB names is not a simple one. There are lots 
of variations and bad legacy. Perhaps here we need to explicitly detect the 
case when a CI check matches a db object (a table or a column), but CS reports 
a pair of events - object deletion and another object creation, and present a 
dialog for the user to decide what to do. Possible options:

1. replace the original names (looks like the most reasonable option)
2. process as delete/create (he effect of this is _almost_ the same as #1? 
except some of the object layer customizations and possibly relationships may 
get lost ... is this a useful option?)
3. Do nothing, effectively preserving the original capitalization (this is the 
current behavior. Do we care to preserve it?)

Also need to analyze how DB import behaves when multiple tables/columns are 
present that only differ in capitalization (i.e. when it is not a renaming)

In any event, this issues has a minor impact, as people usually don't randomly 
change name capitalization. 



  was:
I just ran into a minor issue with DB import Modeler process. 

Given: A table with lowercase table name and uppercase column names 

1. DB Import the table to Cayenne. Import preserves correct capitalization. 
2. Due to a change in project naming conventions, column name capitalization 
was changed to lowercase.
3. Rerun DB import.. Result: no changes were reported, and I had to adjust the 
model by hand.

So DB Import is CS for new names, but is CI when checking for changes. 

The topic of case sensitivity of DB names is not a simple one. There are lots 
of variations and bad legacy. Perhaps here we need to explicitly detect the 
case when a CI check matches a db object (a table or a column), but CS reports 
a pair of events - object deletion and another object creation, and present a 
dialog for the user to decide what to do. Possible options:

1. replace the original names (looks like the most reasonable option
2. process as delete/create (he effect of this is _almost_ the same as #1? 
except some of the object layer customizations and possibly relationships may 
get lost ... is this a useful option?)
3. Do nothing, effectively preserving the original capitalization (this is the 
current behavior. Do we care to preserve it?)

Also need to analyze how DB import behaves when multiple tables/columns are 
present that only differ in capitalization (i.e. when it is not a renaming)

In any event, this issues has a minor impact, as people usually don't randomly 
change name capitalization. 




> DBImport and DB name case sensitivity
> -------------------------------------
>
>                 Key: CAY-2639
>                 URL: https://issues.apache.org/jira/browse/CAY-2639
>             Project: Cayenne
>          Issue Type: Improvement
>    Affects Versions: 4.1.RC2
>         Environment: MySQL 5.7
>            Reporter: Andrus Adamchik
>            Priority: Minor
>
> I just ran into a minor issue with DB import Modeler process. 
> Given: A table with lowercase table name and uppercase column names 
> 1. DB Import the table to Cayenne. Import preserves correct capitalization. 
> 2. Due to a change in project naming conventions, column name capitalization 
> was changed to lowercase.
> 3. Rerun DB import.. Result: no changes were reported, and I had to adjust 
> the model by hand.
> So DB Import is CS for new names, but is CI when checking for changes. 
> The topic of case sensitivity of DB names is not a simple one. There are lots 
> of variations and bad legacy. Perhaps here we need to explicitly detect the 
> case when a CI check matches a db object (a table or a column), but CS 
> reports a pair of events - object deletion and another object creation, and 
> present a dialog for the user to decide what to do. Possible options:
> 1. replace the original names (looks like the most reasonable option)
> 2. process as delete/create (he effect of this is _almost_ the same as #1? 
> except some of the object layer customizations and possibly relationships may 
> get lost ... is this a useful option?)
> 3. Do nothing, effectively preserving the original capitalization (this is 
> the current behavior. Do we care to preserve it?)
> Also need to analyze how DB import behaves when multiple tables/columns are 
> present that only differ in capitalization (i.e. when it is not a renaming)
> In any event, this issues has a minor impact, as people usually don't 
> randomly change name capitalization. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to