From ae73656aec0f31a7ebecb325e5d75c84747af867 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 27 Sep 2012 16:34:30 -0400 Subject: [PATCH] Fixed case-sensitivity bug on setting a compound primary key from an annotation (issue 12) --- docs/05_releases.mkd | 1 + src/com/iciql/TableDefinition.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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%))   *released %BUILDDATE%* +- Fixed case-sensitivity bug on setting a compound primary key from an annotation (issue 12) - Implemented readonly view support. (issue 8)
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.
This allows for an inheritance hierarchy like:
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 { */ private void setPrimaryKey(List columnNames) { primaryKeyColumnNames = Utils.newArrayList(columnNames); + List 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()); } } -- 2.39.5