Conflicts: pom.xml src/main/java/com/iciql/Query.javapull/50/head^2
@@ -2,6 +2,14 @@ | |||
All notable changes to this project will be documented in this file. | |||
This project adheres to [Semantic Versioning](http://semver.org/). | |||
### [2.2.1] - 2021-05-02 | |||
#### Fixed | |||
- Fix Oracle model generation #35 | |||
- Improve simple JOIN #36 | |||
- Several Dependabot updates | |||
### [2.2.0] - 2017-01-31 | |||
#### Added | |||
- Added bitwise AND and XOR DSL for where clauses | |||
@@ -346,7 +354,8 @@ db.executeUpdate(q, new Date()); | |||
QueryConditon.smaller => QueryCondition.lessThan | |||
QueryConditon.smallEqual => QueryCondition.atMost | |||
[unreleased]: https://github.com/gitblit/iciql/compare/release-2.2.0...HEAD | |||
[unreleased]: https://github.com/gitblit/iciql/compare/release-2.2.1...HEAD | |||
[2.2.1]: https://github.com/gitblit/iciql/compare/release-2.2.1...release-2.2.0 | |||
[2.2.0]: https://github.com/gitblit/iciql/compare/release-2.2.0...release-2.1.1 | |||
[2.1.1]: https://github.com/gitblit/iciql/compare/release-2.1.0...release-2.1.1 | |||
[2.1.0]: https://github.com/gitblit/iciql/compare/release-2.0.0...release-2.1.0 |
@@ -19,7 +19,7 @@ | |||
<scm> | |||
<connection>scm:git:git://github.com/gitblit/iciql.git</connection> | |||
<developerConnection>scm:git:git@github.com/gitblit/iciql.git</developerConnection> | |||
<developerConnection>scm:git:git@github.com:gitblit/iciql.git</developerConnection> | |||
<url>https://github.com/gitblit/iciql</url> | |||
<tag>HEAD</tag> | |||
</scm> | |||
@@ -91,7 +91,7 @@ | |||
<dependency> | |||
<groupId>mysql</groupId> | |||
<artifactId>mysql-connector-java</artifactId> | |||
<version>6.0.5</version> | |||
<version>8.0.16</version> | |||
<type>jar</type> | |||
<scope>provided</scope> | |||
</dependency> | |||
@@ -140,7 +140,7 @@ | |||
<dependency> | |||
<groupId>com.thoughtworks.xstream</groupId> | |||
<artifactId>xstream</artifactId> | |||
<version>1.4.9</version> | |||
<version>1.4.16</version> | |||
<type>jar</type> | |||
<scope>provided</scope> | |||
</dependency> | |||
@@ -155,7 +155,7 @@ | |||
<dependency> | |||
<groupId>junit</groupId> | |||
<artifactId>junit</artifactId> | |||
<version>4.11</version> | |||
<version>4.13.1</version> | |||
<type>jar</type> | |||
<scope>test</scope> | |||
</dependency> |
@@ -295,7 +295,7 @@ public class Query<T> { | |||
def.appendSelectList(stat, from.getAs()); | |||
} else { | |||
def.appendSelectList(stat); | |||
} | |||
} | |||
appendFromWhere(stat); | |||
ResultSet rs = stat.executeQuery(); | |||
try { |
@@ -163,7 +163,9 @@ public class TableInspector { | |||
} | |||
} | |||
if (!col.isAutoIncrement) { | |||
col.defaultValue = rs.getString("COLUMN_DEF"); | |||
if(rs.getType() != ResultSet.TYPE_FORWARD_ONLY) { | |||
col.defaultValue = rs.getString("COLUMN_DEF"); | |||
} | |||
} | |||
columns.put(col.name.toLowerCase(), col); | |||
} |
@@ -58,13 +58,24 @@ public class JoinTest { | |||
.select(new UserNote() { | |||
{ | |||
userId = n.userId; | |||
noteId = n.noteId; | |||
id = n.id; | |||
text = n.text; | |||
} | |||
}); | |||
assertEquals(3, notes.size()); | |||
} | |||
@Test | |||
public void testPrimitiveJoinAndSimpleSelect() throws Exception { | |||
final UserId u = new UserId(); | |||
final UserNote n = new UserNote(); | |||
List<UserId> userIds = db.from(u).innerJoin(n).on(u.id).is(n.userId).where(n.text).is("D") | |||
.select(); | |||
assertEquals(1, userIds.size()); | |||
assertEquals(1, userIds.get(0).id); | |||
} | |||
@Test | |||
public void testJoin() throws Exception { | |||
final UserId u = new UserId(); | |||
@@ -140,7 +151,7 @@ public class JoinTest { | |||
public static class UserNote { | |||
@IQColumn(autoIncrement = true, primaryKey = true) | |||
public int noteId; | |||
public int id; | |||
@IQColumn | |||
public int userId; |
@@ -133,7 +133,7 @@ public class ModelsTest { | |||
} else if (dbName.equals("Apache Derby")) { | |||
// Derby uses java.sql.Timestamp not java.util.Date | |||
// Derby uses username as schema name | |||
assertEquals(1643, models.get(0).length()); | |||
assertEquals(1601, models.get(0).length()); | |||
} else if (dbName.equals("PostgreSQL")) { | |||
assertEquals(1643, models.get(0).length()); | |||
} else if (dbName.equals("MySQL")) { |