Skip to content

Commit

Permalink
version 0.0.26
Browse files Browse the repository at this point in the history
manage BOOLEAN type not available in SybaseASA
  • Loading branch information
Philippe Bajoit committed Apr 9, 2019
1 parent 83748de commit 167bccb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.jminiorm</groupId>
<artifactId>jminiorm</artifactId>
<version>0.0.25</version>
<version>0.0.26</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/org/jminiorm/dialect/SybaseASASQLDialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@ protected String sqlForAutoIncrement() {
@Override
public String sqlForCreateSchema(String schema) {
// SybaseASA does not support the common concept of schema, however a schema is auto-created par user, with an identical name
// the user created is never used for login so the password has not to be known
// as no IF NOT EXISTS is available, it is better not to use it for the moment
// return "CREATE USER " + identifier(schema, false) + " IDENTIFIED BY " + quoteIdentifier(UUID.randomUUID().toString());
return null;
}

@Override
protected String sqlForColumnType(Class<?> javaType, Integer length, Integer scale, Integer precision,
boolean generated) {
if ((javaType == Boolean.class) || (javaType == boolean.class))
return "INTEGER";
else return super.sqlForColumnType(javaType, length, scale, precision, generated);
}

@Override
public String sqlForSelect(String sql, Integer limit, Integer offset) {
String expr = "";
Expand All @@ -28,5 +39,4 @@ public String sqlForSelect(String sql, Integer limit, Integer offset) {
sql = sql.replaceAll("(?i)^select ", "select " + expr);
return sql;
}

}

0 comments on commit 167bccb

Please sign in to comment.