com.jpattern.orm.generator.wrapper.JodaDateMidnightToSqlDateWrapper Maven / Gradle / Ivy
package com.jpattern.orm.generator.wrapper;
import java.sql.Date;
import org.joda.time.DateMidnight;
/**
*
* @author Francesco Cina'
*
* Mar 27, 2012
*/
public class JodaDateMidnightToSqlDateWrapper implements TypeWrapper {
@Override
public Class resultSetTypeToUse() {
return Date.class;
}
@Override
public Class wrapperClass() {
return DateMidnight.class;
}
@Override
public DateMidnight wrap(final Date value) {
if (value==null) {
return null;
}
return new DateMidnight(value.getTime());
}
@Override
public Date unWrap(final DateMidnight value) {
if (value==null) {
return null;
}
return new Date(value.getMillis());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy