-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from tdilber/spring-boot-3.x
Spring boot 3.x
- Loading branch information
Showing
46 changed files
with
2,263 additions
and
71 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
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
20 changes: 20 additions & 0 deletions
20
src/main/java/com/beyt/jdq/exception/DynamicQueryIllegalArgumentException.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,20 @@ | ||
package com.beyt.jdq.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
/** | ||
* Created by tdilber at 14-Seo-2024 | ||
*/ | ||
@Slf4j | ||
public class DynamicQueryIllegalArgumentException extends IllegalArgumentException { | ||
|
||
public DynamicQueryIllegalArgumentException(String errorMessage) { | ||
super(errorMessage); | ||
log.error(errorMessage, this); | ||
} | ||
|
||
public DynamicQueryIllegalArgumentException(String errorMessage, Throwable err) { | ||
super(errorMessage, err); | ||
log.error(errorMessage, err); | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
src/main/java/com/beyt/jdq/util/field/helper/TimestampFieldHelper.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,34 @@ | ||
package com.beyt.jdq.util.field.helper; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import java.text.DateFormat; | ||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
import java.sql.Timestamp; | ||
|
||
/** | ||
* Created by tdilber at 11/17/2020 | ||
*/ | ||
@Slf4j | ||
public class TimestampFieldHelper implements IFieldHelper<Timestamp> { | ||
@Override | ||
public Timestamp fillRandom() { | ||
return new Timestamp(System.currentTimeMillis() + random.nextInt(1000000000)); | ||
} | ||
|
||
@Override | ||
public Timestamp fillValue(String value) { | ||
DateFormat dateFormat = new SimpleDateFormat(); | ||
try { | ||
return new Timestamp(dateFormat.parse(value).getTime()); | ||
} catch (ParseException e) { | ||
throw new IllegalStateException(e.getMessage(), e); | ||
} | ||
} | ||
|
||
@Override | ||
public String createGeneratorCode(String value) { | ||
return "new Timestamp(" + fillValue(value).getTime() + "L)"; | ||
} | ||
} |
Oops, something went wrong.