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

org.jeecg.config.mongodb.converter.Decimal128ToBigDecimalConverter Maven / Gradle / Ivy

There is a newer version: 3.7.1
Show newest version
package org.jeecg.config.mongodb.converter;
import org.bson.types.Decimal128;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;
import java.math.BigDecimal;

/**
 * mongo--->java  即Decimal128变为BigDecimal的转换器
 */
@ReadingConverter //告诉spring从数据库读的时候用这个转换
public class Decimal128ToBigDecimalConverter implements Converter {
    @Override
    public BigDecimal convert(Decimal128 decimal128) {
        return decimal128.bigDecimalValue();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy