mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-22 02:46:59 +00:00
Refactor ScalarType remove loadIgnore() method to implement in BeanProperty & DynamicPropertyBase
This commit is contained in:
@@ -101,12 +101,6 @@ public interface ScalarType<T> extends StringParser, StringFormatter, ScalarData
|
||||
@Override
|
||||
T read(DataReader reader) throws SQLException;
|
||||
|
||||
/**
|
||||
* Ignore the reading of this value. Typically, this means moving the index
|
||||
* position in the ResultSet.
|
||||
*/
|
||||
void loadIgnore(DataReader reader);
|
||||
|
||||
/**
|
||||
* Convert (if necessary) and bind the value to the preparedStatement.
|
||||
* <p>
|
||||
|
||||
@@ -36,9 +36,4 @@ public abstract class ScalarTypeBase<T> implements ScalarType<T> {
|
||||
return formatValue((T) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader reader) {
|
||||
reader.incrementPos(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DbReadContext ctx) {
|
||||
scalarType.loadIgnore(ctx.dataReader());
|
||||
ctx.dataReader().incrementPos(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class DynamicPropertyBase implements STreeProperty {
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DbReadContext ctx) {
|
||||
scalarType.loadIgnore(ctx.dataReader());
|
||||
ctx.dataReader().incrementPos(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,11 +57,6 @@ public final class ScalarTypeBytesEncrypted implements ScalarType<byte[]> {
|
||||
return baseType.jdbcNative();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader reader) {
|
||||
baseType.loadIgnore(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jsonWrite(JsonGenerator writer, byte[] value) throws IOException {
|
||||
writer.writeBinary(value);
|
||||
|
||||
@@ -99,11 +99,6 @@ public final class ScalarTypeEncryptedWrapper<T> implements ScalarType<T>, Local
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader dataReader) {
|
||||
wrapped.loadIgnore(dataReader);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String format(Object v) {
|
||||
|
||||
@@ -43,11 +43,6 @@ class ScalarTypeNotFound implements ScalarType<Void> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader reader) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(DataBinder binder, Void value) throws SQLException {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -134,11 +134,6 @@ public class ScalarTypeWrapper<B, S> implements ScalarType<B> {
|
||||
return converter.wrapValue(sv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader reader) {
|
||||
reader.incrementPos(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public B read(DataReader reader) throws SQLException {
|
||||
S sv = scalarType.read(reader);
|
||||
|
||||
@@ -86,11 +86,6 @@ abstract class ScalarTypePgisBase<T extends Geometry> implements ScalarType<T> {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader reader) {
|
||||
reader.incrementPos(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toJdbcType(Object value) {
|
||||
return null;
|
||||
|
||||
@@ -77,11 +77,6 @@ abstract class ScalarTypeGeoLatteBase<T extends Geometry> implements ScalarType<
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DataReader reader) {
|
||||
reader.incrementPos(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object toJdbcType(Object value) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user