All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jpattern.orm.generator.wrapper.LongToBigDecimalWrapper Maven / Gradle / Ivy

There is a newer version: 3.5.1
Show newest version
package com.jpattern.orm.generator.wrapper;

import java.math.BigDecimal;

/**
 * 
 * @author Francesco Cina'
 *
 * Apr 1, 2012
 */
public class LongToBigDecimalWrapper implements TypeWrapper {

	@Override
	public Class resultSetTypeToUse() {
		return BigDecimal.class;
	}

	@Override
	public Class wrapperClass() {
		return Long.class;
	}

	@Override
	public Long wrap(final BigDecimal value) {
		if (value==null) {
			return null;
		}
		return value.longValue();
	}

	@Override
	public BigDecimal unWrap(final Long value) {
		if (value==null) {
			return null;
		}
		return BigDecimal.valueOf(value);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy