com.jpattern.orm.generator.wrapper.IntegerToBigDecimalWrapper Maven / Gradle / Ivy
package com.jpattern.orm.generator.wrapper;
import java.math.BigDecimal;
/**
*
* @author Francesco Cina'
*
* Apr 1, 2012
*/
public class IntegerToBigDecimalWrapper implements TypeWrapper {
@Override
public Class resultSetTypeToUse() {
return BigDecimal.class;
}
@Override
public Class wrapperClass() {
return Integer.class;
}
@Override
public Integer wrap(final BigDecimal value) {
if (value==null) {
return null;
}
return value.intValue();
}
@Override
public BigDecimal unWrap(final Integer value) {
if (value==null) {
return null;
}
return BigDecimal.valueOf(value);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy