diff options
author | James Moger <james.moger@gmail.com> | 2012-09-27 16:34:30 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2012-09-27 16:34:30 -0400 |
commit | ae73656aec0f31a7ebecb325e5d75c84747af867 (patch) | |
tree | aedf772dfc3ec62d6a5acaa6aeb27f8dc33e6c77 /src | |
parent | c42ebc94e34b3a1aa27c292188e73f5b06af814a (diff) | |
download | iciql-ae73656aec0f31a7ebecb325e5d75c84747af867.tar.gz iciql-ae73656aec0f31a7ebecb325e5d75c84747af867.zip |
Fixed case-sensitivity bug on setting a compound primary key from an annotation (issue 12)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/iciql/TableDefinition.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/iciql/TableDefinition.java b/src/com/iciql/TableDefinition.java index aa25722..de2b9ed 100644 --- a/src/com/iciql/TableDefinition.java +++ b/src/com/iciql/TableDefinition.java @@ -209,9 +209,13 @@ public class TableDefinition<T> { */
private void setPrimaryKey(List<String> columnNames) {
primaryKeyColumnNames = Utils.newArrayList(columnNames);
+ List<String> pkNames = Utils.newArrayList();
+ for (String name : columnNames) {
+ pkNames.add(name.toLowerCase());
+ }
// set isPrimaryKey flag for all field definitions
for (FieldDefinition fieldDefinition : fieldMap.values()) {
- fieldDefinition.isPrimaryKey = this.primaryKeyColumnNames.contains(fieldDefinition.columnName);
+ fieldDefinition.isPrimaryKey = pkNames.contains(fieldDefinition.columnName.toLowerCase());
}
}
|