You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CHANGELOG.md 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. ## Changelog
  2. All notable changes to this project will be documented in this file.
  3. This project adheres to [Semantic Versioning](http://semver.org/).
  4. ### [2.1.1] - 2016-04-07
  5. #### Added
  6. - Add explicit `where(String)` method to help with non-Java language interop
  7. ### [2.1.0] - 2016-04-06
  8. #### Added
  9. - Add methods to select counts of a group by field (*SELECT field, COUNT(*) FROM table [WHERE conditions] GROUP BY field*)
  10. ### [2.0.0] - 2016-04-04
  11. The groupId of the Maven dependency has changed to `com.gitblit.iciql`.
  12. Distributing binaries through Maven Central.
  13. #### Fixed
  14. - Fixed order by descending on primitives (issue-21)
  15. - Fixed setting null column values (issue-22)
  16. - Fixed Postgres 9.5 Upsert syntax (issue-23)
  17. #### Added
  18. - Added groupBy methods to QueryWhere (issue-20)
  19. - Allow selecting a column from a table
  20. ### [1.6.5] - 2015-07-21
  21. #### Fixed
  22. - Strip column identifiers from specified column names when mapping JDBC ResultSets to fields
  23. ### [1.6.4] - 2015-06-30
  24. #### Added
  25. - Support Set, List, and Map types for columns when used with DataTypeAdapter
  26. ### [1.6.3] - 2015-06-29
  27. #### Fixed
  28. - Fix column mapping on wildcard select JOIN statements
  29. #### Changed
  30. - Add support for the upcoming PostgreSQL 9.5 UPSERT syntax
  31. ### [1.6.2] - 2015-05-11
  32. #### Fixed
  33. - Reverted change which keyed DataTypeAdapters by the target Java type
  34. ### [1.6.1] - 2015-05-11
  35. Respin of 1.6.0
  36. ### [1.6.0] - 2015-05-11
  37. #### Fixed
  38. - Fix column inheritance from superclasses (pr-14)
  39. - Use webapp classloader rather than global classloader (pr-12)
  40. - Fix deserialization of null values
  41. #### Changed
  42. - Improve SQLite dialect based on upstream JDBC improvements
  43. - Key DataTypeAdapters by target Java type
  44. - Drop precision and length from SQL->Java type determination
  45. - Improve readability of the generated performance benchmark table
  46. - Added Derby TCP benchmark test
  47. ### [1.5.0] - 2014-11-10
  48. #### Fixed
  49. - Fix SQLite INTEGER PRIMARY KEY AUTOINCREMENT mapping
  50. #### Changed
  51. - Improved automatic date conversions
  52. - Revised data type adapters to be specified separately with the @TypeAdapter annotation
  53. #### Added
  54. - Add runtime mode support (DEV, TEST, & PROD)
  55. - Add a DAO feature similar to JDBI
  56. - Added Gson, XStream, and SnakeYaml type adapters
  57. ### [1.4.0] - 2014-11-05
  58. #### Changed
  59. - Table constraints are now defined as part of CREATE TABLE instead of afterwards with indivudual ALTER TABLE statements. This is more portable across database backends.
  60. #### Added
  61. - Support for specifying custom data type adapters in @IQColumn and Define.typeAdapter()
  62. - Added com.iciql.SQLDialectPostgreSQL.JsonStringAdapter
  63. - Added com.iciql.SQLDialectPostgreSQL.XmlStringAdapter
  64. - Added com.iciql.JavaSerializationTypeAdapter to (de)serialize objects into a BLOB column
  65. - Added an SQLite dialect
  66. ### [1.3.0] - 2014-10-22
  67. If you are upgrading and using EnumId mapping you will have to update your enums to define the target class for the EnumId interface since it is now generified.
  68. Switching to using generic types with the EnumId interface allows you to implement alternative enum-type mappings which may make more sense for your business logic.
  69. #### Fixed
  70. - Return null NPE in selectFirst() if list is empty (pr-5)
  71. - Fix Moxie toolkit download URL (pr-6)
  72. - Be more careful with primitive numeric type rollovers (pr-6)
  73. #### Changed
  74. - Revised EnumId interface to support generic types (pr-6)
  75. #### Added
  76. - Add syntax oneOf/noneOf for IN and NOT IN (pr-7)
  77. - Add support for compound nested AND/OR conditions (pr-8)
  78. - Add support for mapping SQL BOOLEAN to primitive numeric types, not just object numeric types
  79. - Add support for customizing EnumId mapping, you can now map enum constants to values of your choice as long as they are a standard type
  80. #### Removed
  81. ### [1.2.0] - 2013-03-25
  82. #### Fixed
  83. - Fixed case-sensitivity bug on setting a compound primary key from an annotation (issue 12)
  84. - Fixed order of DEFAULT value in create table statement (issue 11)
  85. - Fixed password bug in model generator (issue 7)
  86. #### Changed
  87. - Support inheriting columns from super.super class, if super.super is annotated.
  88. This allows for an inheritance hierarchy like:
  89. @IQTable class MyTable -> @IQView abstract class MyBaseView -> @IQView class MyConstrainedView
  90. #### Added
  91. - Implemented readonly view support. (issue 8)
  92. 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.
  93. - Support inheritance of IQVersion for DbUpgrader implementations (issue 10)
  94. - Added @IQConstraintForeignKey annotation (issue 13)
  95. - Added MS SQL Server dialect (issue 14)
  96. ### [1.1.0] - 2012-08-20
  97. #### Changed
  98. - All bulk operations (insert all, update all, delete all) now use JDBC savepoints to ensure atomicity of the transaction
  99. ### [1.0.0] - 2012-07-14
  100. #### Fixed
  101. - Fixed bug in using 0L primitive values in where clauses. These were confused with the COUNT(*) function. (Github/kc5nra,issue 5)
  102. #### Changed
  103. - Issue CREATE TABLE and CREATE INDEX statements once per-db instance/table-mapping
  104. #### Added
  105. - Added support for single column subquery
  106. select name, address from user_table where user_id in (select user_id from invoice table where paid = false)
  107. - Added support for left outer join (Github/backpaper0)
  108. ### [0.7.10] - 2012-01-27
  109. #### Fixed
  110. - Fixed default String value bug where a default empty string threw an IndexOutOfBounds exception
  111. ### [0.7.9] - 2012-01-24
  112. #### Added
  113. - Added toParameter() option for SET commands and allow generating parameterized UPDATE statements
  114. ```java
  115. String q = db.from(t).set(t.timestamp).toParameter().where(t.id).is(5).toSQL();
  116. db.executeUpdate(q, new Date());
  117. ```
  118. ### [0.7.8] - 2012-01-11
  119. #### Fixed
  120. - Replaced non-threadsafe counter used for assigning AS identifiers in JOIN statements with an AtomicInteger
  121. - Prevent negative rollover of the AS counter
  122. - Fixed bug in Query.select(Z z) which assumed that Z must always be an anonymous inner class which may not always be true. This allows for specifying an existing alias to force table or identifier usage in the generated select list. This is very useful for DISTINCT JOIN statements where only the columns of the primary table are of interest.
  123. #### Added
  124. - Added optional alias parameter to Query.toSQL and QueryWhere.toSQL to force generated statement to prefix an AS identifier or, alternatively, the tablename.
  125. - Query.toSQL(boolean distinct, K alias)
  126. - QueryWhere.toSQL(boolean distinct, K alias)
  127. ### [0.7.7] - 2012-01-05
  128. #### Changed
  129. - Disallow declaring and explicitly referencing multiple instances of an enum type within a single model.
  130. A runtime exception will be thrown if an attempt to use where/set/on/and/or/groupBy/orderBy(enum) and your model has multiple fields of a single enum type.
  131. #### Added
  132. - added Query.toSQL() and QueryWhere.toSQL() methods which, when combined with the following new methods, allows for generation of a parameterized, static sql string to be reused with a dynamic query or a PreparedStatement.
  133. - QueryCondition.isParameter()
  134. - QueryCondition.atLeastParameter()
  135. - QueryCondition.atMostParameter()
  136. - QueryCondition.exceedsParameter()
  137. - QueryCondition.lessThanParameter()
  138. - QueryCondition.likeParameter()
  139. - QueryCondition.isNotParameter()
  140. ### [0.7.6] - 2011-12-21
  141. #### Changed
  142. - Iciql now tries to instantiate a default value from an annotated default value IFF the field object is null, it is specified nullable = false, and a defaultValue exists. This only applies to db.insert or db.update.
  143. ### [0.7.5] - 2011-12-12
  144. #### Fixed
  145. - Iciql now identifies wildcard queries and builds a dynamic column lookup. Otherwise, the original field-position-based approach is used. This corrects the performance regression released in 0.7.4 while still fixing the wildcard statement column mapping problem.
  146. ### [0.7.4] - 2011-12-06
  147. #### Fixed
  148. - Fixed JOIN ON primitives
  149. - Fixed GROUP BY primitives
  150. - Fixed primitive references when selecting into a custom type with primitives
  151. - Fixed inherited JaQu bug related to model classes and wildcard queries (select *).
  152. Iciql maps resultset columns by the index of the model class field from a list. This assumes that all columns in the resultset have a corresponding model field definition. This works fine for most queries because iciql explicitly selects columns from the table (select alpha, beta...) when you execute select().
  153. The problem is when iciql issues a dynamic wildcard query and your model does not represent all columns in the resultset: columns and fields may fail to correctly line-up.
  154. Iciql now maps all fields by their column name, not by their position.
  155. #### Changed
  156. - Disallow declaring and explicitly referencing multiple primitive booleans in a single model. A runtime exception will be thrown if an attempt to use where/set/on/and/or/groupBy/orderBy(boolean) and your model has multiple mapped primitive boolean fields.
  157. #### Added
  158. - Added list alternatives to the varargs methods because it was too easy to forget list.toArray()
  159. - Db.executeQuery(Class<? extends T> modelClass, String sql, List<?> args)
  160. - Db.executeQuery(String sql, List<?> args)
  161. - Query.where(String fragment, List<?> args)
  162. ### [0.7.3] - 2011-12-06
  163. #### Fixed
  164. - Fixed JOIN ON primitives
  165. - Fixed GROUP BY primitives
  166. - Fixed primitive references when selecting into a custom type with primitives
  167. #### Changed
  168. - Improved fluent/type-safety of joins
  169. ### [0.7.2] - 2011-11-30
  170. #### Changed
  171. - generated models are now serializable with a default serial version id of 1
  172. ### [0.7.1] - 2011-08-31
  173. #### Fixed
  174. - Fix to PostgreSQL dialect when creating autoincrement columns
  175. - Fix to default dialect when creating autoincrement columns
  176. #### Changed
  177. - Undeprecated interface configuration
  178. - Interface configuration now maps ALL fields, not just public fields
  179. - Overhauled test suite and included more database configurations
  180. - Documented POJO configuration option (limited subset of interface configuration)
  181. #### Added
  182. - Added @IQIgnore annotation to explicitly skip fields for interface configuration
  183. - Created additional Define static methods to bring interface configuration to near-parity with annotation configuration
  184. - Added Db.open(url) method
  185. ### [0.7.0] - 2011-08-17
  186. #### Changed
  187. - Finished MySQL dialect implementation. MySQL 5.0.51b passes 100% of tests.
  188. - Renamed StatementLogger to IciqlLogger
  189. - Overhauled test suite and included more database configurations
  190. #### Added
  191. - Added PostgreSQL dialect. PostgreSQL 9.0 passes all but the boolean-as-int tests.
  192. - Added Db.dropTable(T) method
  193. - Added IciqlLogger.warn method
  194. - Added IciqlLogger.drop method
  195. ### [0.6.6] - 2011-08-15
  196. #### Changed
  197. - Disabled two concurrency unit tests since I believe they are flawed and do not yield reproducible results
  198. #### Added
  199. - Implemented HSQLDB MERGE syntax. HSQL 2.2.4 fails 1 test which is bug-3390047 in HSQLDB.
  200. - Added Derby database dialect. Derby 10.7.1.1 and 10.8.1.2 pass 100% of tests.
  201. ### [0.6.5] - 2011-08-12
  202. #### Fixed
  203. - fixed failure of db.delete(PrimitiveModel) and db.update(PrimitiveModel)
  204. ### [0.6.4] - 2011-08-12
  205. #### Fixed
  206. - do not INSERT primitive autoIncrement fields, let database assign value
  207. #### Changed
  208. - @IQTable.createIfRequired -> @IQTable.create
  209. - unspecified length String fields are now CLOB instead of TEXT. dialects can intercept this and convert to another type. e.g. MySQL dialect can change CLOB to TEXT.
  210. - java.lang.Boolean now maps to BOOLEAN instead of BIT
  211. - expressions on unmapped fields will throw an IciqlException
  212. - expressions on unsupported types will throw an IciqlException
  213. - moved dialects back to main package
  214. - moved create table and create index statement generation into dialects
  215. - renamed _iq_versions table to iq_versions since leading _ character is troublesome for some databases
  216. - @IQColumn(allowNull=true) -> @IQColumn(nullable=true)
  217. - All Object columns are assumed NULLABLE unless explicitly set @IQColumn(nullable = false)
  218. - All Primitive columns are assumed NOT NULLABLE unless explicitly set @IQColumn(nullable = true)
  219. - changed @IQTable.primaryKey definition to use array of column names (@IQTable( primaryKey = {"name", "nickname"}) )
  220. #### Added
  221. - full support for primitives in all clauses
  222. - DECIMAL(length, scale) support
  223. - improved exception reporting by including generated statement, if available
  224. - improved automatic dialect determination on pooled connections
  225. - added HSQL dialect. HSQL fails 4 out of 50 unit tests. (2 failures are unimplemented merge, 1 is a bug-3390047 in HSQLDB, 1 is a concurreny issue)
  226. - added untested MySQL dialect
  227. - allow defining table create DEFAULT values from default object values (Date myDate = new Date(100, 1, 1); => CREATE TABLE ... myDate DATETIME DEFAULT '2000-02-01 00:00:00')
  228. ### [0.6.3] - 2011-08-08
  229. #### Changed
  230. - Moved dialects into separate package
  231. - finished enum support (issue 4)
  232. #### Added
  233. - added UUID type support (H2 databases only)
  234. - added partial primitives support (primitives may not be used for compile-time condition clauses)
  235. - added between(A y).and(A z) condition syntax
  236. ### [0.6.2] - 2011-08-05
  237. #### Fixed
  238. - fix to versioning to support H2 1.3.158+
  239. #### Changed
  240. - @IQSchema(name="public") => @IQSchema("public")
  241. - @IQDatabase(version=2) => @IQVersion(2)
  242. - @IQTable(version=2) => @IQVersion(2)
  243. - @IQIndex annotation simplified to be used for one index definition and expanded to specify index name
  244. - @IQColumn(maxLength=20) => @IQColumn(length=20)
  245. - @IQColumn(trimString=true) => @IQColumn(trim=true)}
  246. #### Added
  247. - added BLOB support (issue 1)
  248. - added java.lang.Enum support (issue 2)
  249. - allow runtime flexible mapping of BOOL columns to Integer fields
  250. - allow runtime flexible mapping of INT columns to Boolean fields
  251. - added @IQIndexes annotation to specify multiple IQIndex annotations
  252. ### [0.5.0] - 2011-08-03
  253. #### Changed
  254. - deprecated model class interface configuration
  255. - added Db.open(Connection conn) method, changed constructor to default scope
  256. - added Db.registerDialect static methods to register custom dialects
  257. - added Query.where(String fragment, Object... args) method to build a runtime query fragment when compile-time queries are too strict
  258. - added Db.executeQuery(String query, Object... args) to execute a complete sql query with optional arguments
  259. - added Db.executeQuery(Class modelClass, String query, Object... args) to execute a complete sql query, with optional arguments, and build objects from the result
  260. - added Db.buildObjects(Class modelClass, ResultSet rs) method to build objects from the ResultSet of a plain sql query
  261. - added ThreadLocal<T> com.iciql.Utils.newThreadLocal(final Class<? extends T> clazz) method
  262. - added optional console statement logger and SLF4J statement logger
  263. - refactored dialect support
  264. - throw IciqlException (which is a RuntimeException) instead of RuntimeException
  265. - synchronized Db.classMap for concurrent sharing of a Db instance
  266. - Database/table versioning uses the _iq_versions table, the _ jq_versions table, if present, is ignored
  267. - Changed the following class names:
  268. org.h2.jaqu.Table => com.iciql.Iciql
  269. org.h2.jaqu.JQSchema => com.iciql.IQSchema
  270. org.h2.jaqu.JQDatabase => com.iciql.IQDatabase
  271. org.h2.jaqu.JQIndex => com.iciql.IQIndex
  272. org.h2.jaqu.JQTable => com.iciql.IQTable
  273. org.h2.jaqu.JQColumn => com.iciql.IQColumn
  274. - Changed the following method names:
  275. org.h2.jaqu.Table.define() => com.iciql.Iciql.defineIQ()
  276. QueryConditon.bigger => QueryCondition.exceeds
  277. QueryConditon.biggerEqual => QueryCondition.atLeast
  278. QueryConditon.smaller => QueryCondition.lessThan
  279. QueryConditon.smallEqual => QueryCondition.atMost
  280. [unreleased]: https://github.com/gitblit/iciql/compare/release-2.1.1...HEAD
  281. [2.1.1]: https://github.com/gitblit/iciql/compare/release-2.1.0...release-2.1.1
  282. [2.1.0]: https://github.com/gitblit/iciql/compare/release-2.0.0...release-2.1.0
  283. [2.0.0]: https://github.com/gitblit/iciql/compare/v1.6.5...release-2.0.0
  284. [1.6.5]: https://github.com/gitblit/iciql/compare/v1.6.4...v1.6.5
  285. [1.6.4]: https://github.com/gitblit/iciql/compare/v1.6.3...v1.6.4
  286. [1.6.3]: https://github.com/gitblit/iciql/compare/v1.6.2...v1.6.3
  287. [1.6.2]: https://github.com/gitblit/iciql/compare/v1.6.1...v1.6.2
  288. [1.6.1]: https://github.com/gitblit/iciql/compare/v1.6.0...v1.6.1
  289. [1.6.0]: https://github.com/gitblit/iciql/compare/v1.5.0...v1.6.0
  290. [1.5.0]: https://github.com/gitblit/iciql/compare/v1.4.0...v1.5.0
  291. [1.4.0]: https://github.com/gitblit/iciql/compare/v1.3.0...v1.4.0
  292. [1.3.0]: https://github.com/gitblit/iciql/compare/v1.2.0...v1.3.0
  293. [1.2.0]: https://github.com/gitblit/iciql/compare/v1.1.0...v1.2.0
  294. [1.1.0]: https://github.com/gitblit/iciql/compare/v1.0.0...v1.1.0
  295. [1.0.0]: https://github.com/gitblit/iciql/compare/v0.7.10...v1.0.0
  296. [0.7.10]: https://github.com/gitblit/iciql/compare/v0.7.9...v0.7.10
  297. [0.7.9]: https://github.com/gitblit/iciql/compare/v0.7.8...v0.7.9
  298. [0.7.8]: https://github.com/gitblit/iciql/compare/v0.7.7...v0.7.8
  299. [0.7.7]: https://github.com/gitblit/iciql/compare/v0.7.6...v0.7.7
  300. [0.7.6]: https://github.com/gitblit/iciql/compare/v0.7.5...v0.7.6
  301. [0.7.5]: https://github.com/gitblit/iciql/compare/v0.7.4...v0.7.5
  302. [0.7.4]: https://github.com/gitblit/iciql/compare/v0.7.3...v0.7.4
  303. [0.7.3]: https://github.com/gitblit/iciql/compare/v0.7.2...v0.7.3
  304. [0.7.2]: https://github.com/gitblit/iciql/compare/v0.7.1...v0.7.2
  305. [0.7.1]: https://github.com/gitblit/iciql/compare/v0.7.0...v0.7.1
  306. [0.7.0]: https://github.com/gitblit/iciql/compare/v0.6.6...v0.7.0
  307. [0.6.6]: https://github.com/gitblit/iciql/compare/v0.6.5...v0.6.6
  308. [0.6.5]: https://github.com/gitblit/iciql/compare/v0.6.4...v0.6.5
  309. [0.6.4]: https://github.com/gitblit/iciql/compare/v0.6.3...v0.6.4
  310. [0.6.3]: https://github.com/gitblit/iciql/compare/v0.6.2...v0.6.3
  311. [0.6.2]: https://github.com/gitblit/iciql/compare/v0.5.0...v0.6.2