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

org.jeecg.config.mongodb.converter.BigDecimalToDecimal128Converter 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.WritingConverter;
import java.math.BigDecimal;

/**
 * java-->mongo  即BigDecimal变为Decimal128的转换器
 */
@WritingConverter//告诉spring往数据库写的时候用这个转换
public class BigDecimalToDecimal128Converter implements Converter {
    @Override
    public Decimal128 convert(BigDecimal bigDecimal) {
        return new Decimal128(bigDecimal);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy