Skip to content

Commit

Permalink
add sqlId() api to SqlEntity interfaces. (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
HidekiSugimoto189 authored Jul 30, 2024
1 parent 09baff3 commit bf52679
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/java/jp/co/future/uroborosql/SqlEntityDeleteImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,38 @@ final class SqlEntityDeleteImpl<E> extends AbstractExtractionCondition<SqlEntity
this.entityType = entityType;
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityDelete#sqlId(java.lang.String)
*/
@Override
public SqlEntityDelete<E> sqlId(final String sqlId) {
context().setSqlId(sqlId);
return this;
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityDelete#retry(int)
*/
@Override
public SqlEntityDelete<E> retry(final int count) {
return retry(count, 0);
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityDelete#retry(int, int)
*/
@Override
public SqlEntityDelete<E> retry(final int count, final int waitTime) {
context().setMaxRetryCount(count).setRetryWaitTime(waitTime);
return this;
}

@Override
public int count() {
try {
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/jp/co/future/uroborosql/SqlEntityQueryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,38 @@ final class SqlEntityQueryImpl<E> extends AbstractExtractionCondition<SqlEntityQ
this.excludeColumns = new ArrayList<>();
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityQuery#sqlId(java.lang.String)
*/
@Override
public SqlEntityQuery<E> sqlId(final String sqlId) {
context().setSqlId(sqlId);
return this;
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityQuery#retry(int)
*/
@Override
public SqlEntityQuery<E> retry(final int count) {
return retry(count, 0);
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityQuery#retry(int, int)
*/
@Override
public SqlEntityQuery<E> retry(final int count, final int waitTime) {
context().setMaxRetryCount(count).setRetryWaitTime(waitTime);
return this;
}

/**
* {@inheritDoc}
*
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/jp/co/future/uroborosql/SqlEntityUpdateImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,38 @@ final class SqlEntityUpdateImpl<E> extends AbstractExtractionCondition<SqlEntity
this.entityType = entityType;
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityUpdate#sqlId(java.lang.String)
*/
@Override
public SqlEntityUpdate<E> sqlId(final String sqlId) {
context().setSqlId(sqlId);
return this;
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityUpdate#retry(int)
*/
@Override
public SqlEntityUpdate<E> retry(final int count) {
return retry(count, 0);
}

/**
* {@inheritDoc}
*
* @see jp.co.future.uroborosql.fluent.SqlEntityUpdate#retry(int, int)
*/
@Override
public SqlEntityUpdate<E> retry(final int count, final int waitTime) {
context().setMaxRetryCount(count).setRetryWaitTime(waitTime);
return this;
}

/**
* {@inheritDoc}
*
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/jp/co/future/uroborosql/fluent/SqlEntityDelete.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@
* @author ota
*/
public interface SqlEntityDelete<E> extends ExtractionCondition<SqlEntityDelete<E>> {
/**
* 発行するSQLに付与するSQL_IDを設定する
*
* @param sqlId SQL_ID文字列
* @return SqlEntityDelete
*/
SqlEntityDelete<E> sqlId(String sqlId);

/**
* リトライ回数を設定する。 リトライ待機時間は0msが設定される
*
* @param count リトライ回数
* @return SqlEntityDelete
*/
SqlEntityDelete<E> retry(int count);

/**
* リトライ回数を設定する
*
* @param count リトライ回数
* @param waitTime リトライ待機時間(ms)
* @return SqlEntityDelete
*/
SqlEntityDelete<E> retry(int count, int waitTime);

/**
* 削除結果の取得(終端処理)
*
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/jp/co/future/uroborosql/fluent/SqlEntityQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ public String toString() {
}
}

/**
* 発行するSQLに付与するSQL_IDを設定する
*
* @param sqlId SQL_ID文字列
* @return SqlEntityQuery
*/
SqlEntityQuery<E> sqlId(String sqlId);

/**
* リトライ回数を設定する。 リトライ待機時間は0msが設定される
*
* @param count リトライ回数
* @return SqlEntityQuery
*/
SqlEntityQuery<E> retry(int count);

/**
* リトライ回数を設定する
*
* @param count リトライ回数
* @param waitTime リトライ待機時間(ms)
* @return SqlEntityQuery
*/
SqlEntityQuery<E> retry(int count, int waitTime);

/**
* 検索結果の取得(終端処理)
*
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/jp/co/future/uroborosql/fluent/SqlEntityUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@
* @author H.Sugimoto
*/
public interface SqlEntityUpdate<E> extends ExtractionCondition<SqlEntityUpdate<E>> {
/**
* 発行するSQLに付与するSQL_IDを設定する
*
* @param sqlId SQL_ID文字列
* @return SqlEntityUpdate
*/
SqlEntityUpdate<E> sqlId(String sqlId);

/**
* リトライ回数を設定する。 リトライ待機時間は0msが設定される
*
* @param count リトライ回数
* @return SqlEntityUpdate
*/
SqlEntityUpdate<E> retry(int count);

/**
* リトライ回数を設定する
*
* @param count リトライ回数
* @param waitTime リトライ待機時間(ms)
* @return SqlEntityUpdate
*/
SqlEntityUpdate<E> retry(int count, int waitTime);

/**
* 更新結果の取得(終端処理)
*
Expand Down

0 comments on commit bf52679

Please sign in to comment.