updated dependencies
This commit is contained in:
@ -20,7 +20,7 @@ limitations under the License.
|
||||
<parent>
|
||||
<artifactId>shared</artifactId>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<version>1.2.2-SNAPSHOT</version>
|
||||
<version>1.3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.muehlencord.shared</groupId>
|
||||
|
||||
@ -47,29 +47,29 @@ public abstract class GenericEnumType<T, E extends Enum<E>> implements UserType,
|
||||
|
||||
for (E e : enumValues) {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
T value = (T) m.invoke(e);
|
||||
@SuppressWarnings("unchecked")
|
||||
T value = (T) m.invoke(e);
|
||||
|
||||
enumMap.put(value.toString(), e);
|
||||
valueMap.put(e, value.toString());
|
||||
enumMap.put(value.toString(), e);
|
||||
valueMap.put(e, value.toString());
|
||||
}
|
||||
this.sqlType = sqlType;
|
||||
this.sqlType = sqlType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException {
|
||||
return nullSafeGet(rs, names, owner);
|
||||
}
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet rs, int index, SharedSessionContractImplementor implementor, Object o) throws SQLException {
|
||||
return nullSafeGet(rs, index, implementor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
|
||||
nullSafeSet(st, value, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object assemble(Serializable cached, Object owner) {
|
||||
return cached;
|
||||
}
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
|
||||
nullSafeSet(st, value, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object assemble(Serializable cached, Object owner) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object deepCopy(Object obj) {
|
||||
@ -94,28 +94,28 @@ public abstract class GenericEnumType<T, E extends Enum<E>> implements UserType,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(Object obj) {
|
||||
return obj.hashCode();
|
||||
}
|
||||
@Override
|
||||
public int hashCode(Object obj) {
|
||||
return obj.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws SQLException {
|
||||
String value = rs.getString(names[0]);
|
||||
if (!rs.wasNull()) {
|
||||
return enumMap.get(value);
|
||||
}
|
||||
return null;
|
||||
public Object nullSafeGet(ResultSet rs, int index, Object owner) throws SQLException {
|
||||
String value = rs.getString(index);
|
||||
if (!rs.wasNull()) {
|
||||
return enumMap.get(value);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void nullSafeSet(PreparedStatement ps, Object obj, int index) throws SQLException {
|
||||
if (obj == null) {
|
||||
ps.setNull(index, sqlType);
|
||||
} else {
|
||||
public void nullSafeSet(PreparedStatement ps, Object obj, int index) throws SQLException {
|
||||
if (obj == null) {
|
||||
ps.setNull(index, sqlType);
|
||||
} else {
|
||||
ps.setObject(index, valueMap.get(obj), sqlType);
|
||||
}
|
||||
}
|
||||
@ -130,9 +130,5 @@ public abstract class GenericEnumType<T, E extends Enum<E>> implements UserType,
|
||||
return clazz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] sqlTypes() {
|
||||
return new int[]{sqlType};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package de.muehlencord.shared.jeeutil.restexfw;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -15,12 +15,12 @@
|
||||
*/
|
||||
package de.muehlencord.shared.jeeutil.restexfw;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.Iterator;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.Path;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -15,23 +15,23 @@
|
||||
*/
|
||||
package de.muehlencord.shared.jeeutil.restexfw;
|
||||
|
||||
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import javax.ws.rs.core.Response.Status;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Joern Muehlencord (joern@muehlencord.de)
|
||||
*/
|
||||
public class ResponseStatusAdapter extends XmlAdapter<String, Response.Status> {
|
||||
public class ResponseStatusAdapter extends XmlAdapter<String, Status> {
|
||||
|
||||
@Override
|
||||
public String marshal(Response.Status status) throws Exception {
|
||||
return status.name();
|
||||
}
|
||||
@Override
|
||||
public String marshal(Response.Status status) throws Exception {
|
||||
return status.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response.Status unmarshal(String statusAsString) throws Exception {
|
||||
return Response.Status.valueOf(statusAsString);
|
||||
}
|
||||
@Override
|
||||
public Response.Status unmarshal(String statusAsString) throws Exception {
|
||||
return Response.Status.valueOf(statusAsString);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user