BAEL-4921- fixed review comments
This commit is contained in:
parent
c764d5a8cb
commit
735a9e9360
@ -40,14 +40,14 @@ public class CustomIntegerArrayType implements UserType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner)
|
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner)
|
||||||
throws HibernateException, SQLException {
|
throws HibernateException, SQLException {
|
||||||
Array array = rs.getArray(names[0]);
|
Array array = rs.getArray(names[0]);
|
||||||
return array != null ? array.getArray() : null;
|
return array != null ? array.getArray() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session)
|
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session)
|
||||||
throws HibernateException, SQLException {
|
throws HibernateException, SQLException {
|
||||||
if (value != null && st != null) {
|
if (value != null && st != null) {
|
||||||
Array array = session.connection().createArrayOf("int", (Integer[])value);
|
Array array = session.connection().createArrayOf("int", (Integer[])value);
|
||||||
st.setArray(index, array);
|
st.setArray(index, array);
|
||||||
|
@ -40,14 +40,14 @@ public class CustomStringArrayType implements UserType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner)
|
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner)
|
||||||
throws HibernateException, SQLException {
|
throws HibernateException, SQLException {
|
||||||
Array array = rs.getArray(names[0]);
|
Array array = rs.getArray(names[0]);
|
||||||
return array != null ? array.getArray() : null;
|
return array != null ? array.getArray() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session)
|
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session)
|
||||||
throws HibernateException, SQLException {
|
throws HibernateException, SQLException {
|
||||||
if (value != null && st != null) {
|
if (value != null && st != null) {
|
||||||
Array array = session.connection().createArrayOf("text", (String[])value);
|
Array array = session.connection().createArrayOf("text", (String[])value);
|
||||||
st.setArray(index, array);
|
st.setArray(index, array);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user