com.jpattern.orm.generator.wrapper.JodaDateTimeToSqlTimestampWrapper Maven / Gradle / Ivy
package com.jpattern.orm.generator.wrapper;
import java.sql.Timestamp;
import org.joda.time.DateTime;
/**
*
* @author Francesco Cina'
*
* Mar 27, 2012
*/
public class JodaDateTimeToSqlTimestampWrapper implements IWrapper {
@Override
public Class resultSetTypeToUse() {
return Timestamp.class;
}
@Override
public DateTime wrap(Timestamp value) {
return new DateTime(value);
}
@Override
public Timestamp unWrap(DateTime value) {
return new Timestamp(value.getMillis());
}
public static DateTime staticWrap(Timestamp value) {
return new DateTime(value);
}
public static Timestamp staticUnWrap(DateTime value) {
return new Timestamp(value.getMillis());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy