summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2012-09-27 16:34:30 -0400
committerJames Moger <james.moger@gmail.com>2012-09-27 16:34:30 -0400
commitae73656aec0f31a7ebecb325e5d75c84747af867 (patch)
treeaedf772dfc3ec62d6a5acaa6aeb27f8dc33e6c77
parentc42ebc94e34b3a1aa27c292188e73f5b06af814a (diff)
downloadiciql-ae73656aec0f31a7ebecb325e5d75c84747af867.tar.gz
iciql-ae73656aec0f31a7ebecb325e5d75c84747af867.zip
Fixed case-sensitivity bug on setting a compound primary key from an annotation (issue 12)
-rw-r--r--docs/05_releases.mkd1
-rw-r--r--src/com/iciql/TableDefinition.java6
2 files changed, 6 insertions, 1 deletions
diff --git a/docs/05_releases.mkd b/docs/05_releases.mkd
index b224363..e4cd9f7 100644
--- a/docs/05_releases.mkd
+++ b/docs/05_releases.mkd
@@ -4,6 +4,7 @@
**%VERSION%** ([zip](http://code.google.com/p/iciql/downloads/detail?name=%ZIP%)|[jar](http://code.google.com/p/iciql/downloads/detail?name=%JAR%)) &nbsp; *released %BUILDDATE%*
+- Fixed case-sensitivity bug on setting a compound primary key from an annotation (issue 12)
- Implemented readonly view support. (issue 8)<br/>
View models may be specified using the IQView annotation or Iciql.define(). Views can either be created automatically as part of a query of the view OR views may be constructed from a fluent statement.
- Support inheriting columns from super.super class, if super.super is annotated.<br/>This allows for an inheritance hierarchy like:<br/>
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());
}
}