-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed escaping in sybase-dialect (#27)
- Loading branch information
1 parent
e13b46f
commit 8116166
Showing
27 changed files
with
258 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
src/main/java/de/jaggl/sqlbuilder/core/columns/datetime/TimeColumn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
package de.jaggl.sqlbuilder.core.columns.datetime; | ||
|
||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_BETWEEN; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_EQUAL_TO; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_GREATER_THAN; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_GREATER_THAN_OR_EQUAL_TO; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_LESS_THAN; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_LESS_THAN_OR_EQUAL_TO; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_NOT_EQUAL_TO; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_NOT_NULL; | ||
import static de.jaggl.sqlbuilder.core.conditions.GenericCondition.GenericConditionType.IS_NULL; | ||
import static java.sql.Types.DATE; | ||
|
||
import java.time.LocalTime; | ||
|
||
import de.jaggl.sqlbuilder.core.columns.Column; | ||
import de.jaggl.sqlbuilder.core.columns.ColumnDefinition; | ||
import de.jaggl.sqlbuilder.core.conditions.Condition; | ||
import de.jaggl.sqlbuilder.core.conditions.GenericCondition; | ||
import de.jaggl.sqlbuilder.core.domain.Placeholder; | ||
import de.jaggl.sqlbuilder.core.schema.Table; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author Martin Schumacher | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
@ToString(callSuper = true) | ||
public class TimeColumn extends Column | ||
{ | ||
public TimeColumn(Table table, String name, String alias, ColumnDefinition columnDefinition) | ||
{ | ||
super(table, name, alias, columnDefinition, DATE); | ||
} | ||
|
||
public TimeColumn as(String alias) | ||
{ | ||
return new TimeColumn(table, name, alias, columnDefinition); | ||
} | ||
|
||
public Condition isEqualTo(LocalTime value) | ||
{ | ||
return value == null ? new GenericCondition(IS_NULL, this) : new GenericCondition(IS_EQUAL_TO, this, value); | ||
} | ||
|
||
public Condition eq(LocalTime value) | ||
{ | ||
return isEqualTo(value); | ||
} | ||
|
||
public Condition isNotEqualTo(LocalTime value) | ||
{ | ||
return value == null ? new GenericCondition(IS_NOT_NULL, this) : new GenericCondition(IS_NOT_EQUAL_TO, this, value); | ||
} | ||
|
||
public Condition nEq(LocalTime value) | ||
{ | ||
return isNotEqualTo(value); | ||
} | ||
|
||
public Condition isAfter(LocalTime value) | ||
{ | ||
return new GenericCondition(IS_GREATER_THAN, this, value); | ||
} | ||
|
||
public Condition isAfter(Column otherColumn) | ||
{ | ||
return new GenericCondition(IS_GREATER_THAN, this, otherColumn); | ||
} | ||
|
||
public Condition isAfter(Placeholder placeholder) | ||
{ | ||
return new GenericCondition(IS_GREATER_THAN, this, placeholder); | ||
} | ||
|
||
public Condition isAfterOrEqualTo(LocalTime value) | ||
{ | ||
return new GenericCondition(IS_GREATER_THAN_OR_EQUAL_TO, this, value); | ||
} | ||
|
||
public Condition isAfterOrEqualTo(Column otherColumn) | ||
{ | ||
return new GenericCondition(IS_GREATER_THAN_OR_EQUAL_TO, this, otherColumn); | ||
} | ||
|
||
public Condition isAfterOrEqualTo(Placeholder placeholder) | ||
{ | ||
return new GenericCondition(IS_GREATER_THAN_OR_EQUAL_TO, this, placeholder); | ||
} | ||
|
||
public Condition isBefore(LocalTime value) | ||
{ | ||
return new GenericCondition(IS_LESS_THAN, this, value); | ||
} | ||
|
||
public Condition isBefore(Column otherColumn) | ||
{ | ||
return new GenericCondition(IS_LESS_THAN, this, otherColumn); | ||
} | ||
|
||
public Condition isBefore(Placeholder placeholder) | ||
{ | ||
return new GenericCondition(IS_LESS_THAN, this, placeholder); | ||
} | ||
|
||
public Condition isBeforeOrEqualTo(LocalTime value) | ||
{ | ||
return new GenericCondition(IS_LESS_THAN_OR_EQUAL_TO, this, value); | ||
} | ||
|
||
public Condition isBeforeOrEqualTo(Column otherColumn) | ||
{ | ||
return new GenericCondition(IS_LESS_THAN_OR_EQUAL_TO, this, otherColumn); | ||
} | ||
|
||
public Condition isBeforeOrEqualTo(Placeholder placeholder) | ||
{ | ||
return new GenericCondition(IS_LESS_THAN_OR_EQUAL_TO, this, placeholder); | ||
} | ||
|
||
public Condition isBetween(LocalTime value1, LocalTime value2) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, value1, value2); | ||
} | ||
|
||
public Condition isBetween(Column otherColumn1, Column otherColumn2) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, otherColumn1, otherColumn2); | ||
} | ||
|
||
public Condition isBetween(LocalTime value, Column otherColumn) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, value, otherColumn); | ||
} | ||
|
||
public Condition isBetween(Column otherColumn, LocalTime value) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, otherColumn, value); | ||
} | ||
|
||
public Condition isBetween(Column otherColumn, Placeholder placeholder) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, otherColumn, placeholder); | ||
} | ||
|
||
public Condition isBetween(LocalTime value, Placeholder placeholder) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, value, placeholder); | ||
} | ||
|
||
public Condition isBetween(Placeholder placeholder, LocalTime value) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, placeholder, value); | ||
} | ||
|
||
public Condition isBetween(Placeholder placeholder, Column otherColumn) | ||
{ | ||
return new GenericCondition(IS_BETWEEN, this, placeholder, otherColumn); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/de/jaggl/sqlbuilder/core/columns/datetime/TimeColumnBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.jaggl.sqlbuilder.core.columns.datetime; | ||
|
||
import java.time.LocalDate; | ||
|
||
import de.jaggl.sqlbuilder.core.columns.ColumnBuilder; | ||
import de.jaggl.sqlbuilder.core.columns.ColumnDefinition; | ||
import de.jaggl.sqlbuilder.core.schema.Table; | ||
|
||
/** | ||
* @author Martin Schumacher | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
public class TimeColumnBuilder extends ColumnBuilder<TimeColumn, TimeColumnBuilder, LocalDate> | ||
{ | ||
public TimeColumnBuilder(Table table, String name) | ||
{ | ||
super(table, name); | ||
} | ||
|
||
@Override | ||
protected TimeColumn getColumnInstance() | ||
{ | ||
return new TimeColumn(table, name, null, new ColumnDefinition("TIME", null, isNullable, isDefaultNull, false, false, defaultValue)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.