-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'string-length-validation' of github.com:FOCONIS/ebean i…
…nto FOCONIS-string-length-validation
- Loading branch information
Showing
15 changed files
with
331 additions
and
9 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
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,22 @@ | ||
package io.ebean.config; | ||
|
||
/** | ||
* Defines the length-check mode. | ||
* | ||
* @author Roland Praml, FOCONIS AG | ||
*/ | ||
public enum LengthCheck { | ||
/** | ||
* By default, length checking is off. This means, strings/jsons and files are passed to the DB and the DB might or might not check the length. | ||
* The DB has to check the data length. Note this is not possible for certain datatypes (e.g. clob without size) | ||
*/ | ||
OFF, | ||
/** | ||
* When enabling length check, ebean validates strings/json strings and files before saving them to DB. | ||
*/ | ||
ON, | ||
/** | ||
* Same as "ON", but take the UTF8-bytelength for validation. This may be useful, if you have an UTF8 based charset (default for DB2) | ||
*/ | ||
UTF8 | ||
} |
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
27 changes: 27 additions & 0 deletions
27
ebean-core-type/src/main/java/io/ebean/core/type/InputStreamInfo.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,27 @@ | ||
package io.ebean.core.type; | ||
|
||
import java.io.InputStream; | ||
|
||
/** | ||
* Helper to transports length info of DataBind.setBinaryStream(stream, length) to BindValidation | ||
* | ||
* @author Roland Praml, FOCONIS AG | ||
*/ | ||
public class InputStreamInfo { | ||
private final InputStream stream; | ||
|
||
private final long length; | ||
|
||
public InputStreamInfo(InputStream stream, long length) { | ||
this.stream = stream; | ||
this.length = length; | ||
} | ||
|
||
public InputStream stream() { | ||
return stream; | ||
} | ||
|
||
public long length() { | ||
return length; | ||
} | ||
} |
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.