Skip to content

Commit

Permalink
fixed a missing space in delete-query in sybase-dialect (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schubi1981 authored Aug 26, 2020
1 parent 8116166 commit d2b3dde
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A Java-Library to build SQL-Statements
<dependency>
<groupId>de.jaggl.sqlbuilder</groupId>
<artifactId>sqlbuilder-core</artifactId>
<version>2.7.0</version>
<version>2.7.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>de.jaggl.sqlbuilder</groupId>
<artifactId>sqlbuilder-core</artifactId>
<version>2.7.1</version>
<version>2.7.2</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ protected void appendSelectStatement(StringBuilder builder, Select select, Build
protected void appendDeleteStatement(StringBuilder builder, Delete delete, BuildingContext context, Indentation indentation)
{
builder.append(context.getDialect().getLabels().getDelete());
if (delete.getLimitation() == null)
{
builder.append(" ");
}
appendLimit(builder, delete.getLimitation(), context, indentation);
if (delete.getLimitation() != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class DeleteTest
private static final VarCharColumn LASTNAME = PERSONS.varCharColumn("lastname").build();
private static final IntColumn AGE = PERSONS.intColumn("age").build();

@Test
void testBuildSimpleDelete()
{
assertThat(deleteFrom(PERSONS).where(LASTNAME.isEqualTo("Schumacher")).build(SYBASE))
.isEqualTo("DELETE FROM `persons` WHERE `persons`.`lastname` = 'Schumacher'");
}

@Test
void testBuildDelete()
{
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/de/jaggl/sqlbuilder/core/queries/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class QueryTest
class QueryTest
{
@Test
public void testPrintAndPrintln()
void testPrintAndPrintln()
{
var query = select().from(create("table"));

Expand Down Expand Up @@ -66,7 +66,7 @@ public void testPrintAndPrintln()

@SuppressWarnings("resource")
@Test
public void testPrepare() throws SQLException
void testPrepare() throws SQLException
{
var query = select().from(create("table"));

Expand All @@ -84,7 +84,7 @@ public void testPrepare() throws SQLException

@SuppressWarnings("resource")
@Test
public void testPrepareWithDialect() throws SQLException
void testPrepareWithDialect() throws SQLException
{
var query = select().from(create("table"));

Expand All @@ -102,7 +102,7 @@ public void testPrepareWithDialect() throws SQLException

@SuppressWarnings("resource")
@Test
public void testPrepareWithDialectName() throws SQLException
void testPrepareWithDialectName() throws SQLException
{
var query = select().from(create("table"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@

import org.junit.jupiter.api.Test;

import de.jaggl.sqlbuilder.core.queries.Query;
import de.jaggl.sqlbuilder.core.queryexecutor.SelectQueryExecutor;
import de.jaggl.sqlbuilder.core.schema.Table;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;

public class QueryableQueryTest
class QueryableQueryTest
{
private static final Table TABLE = Table.create("table");
private SelectQueryExecutor<MyClass> selectQueryExecutor = new MySelectQueryExecutor();
Expand Down

0 comments on commit d2b3dde

Please sign in to comment.