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

com.itcoon.common.jpa.converter.AbstractJpaEnumConverter Maven / Gradle / Ivy

There is a newer version: 1.1.2.RELEASE
Show newest version
package com.itcoon.common.jpa.converter;

import com.itcoon.common.core.converter.AbstractEnumConverter;
import com.itcoon.common.core.enums.ValueEnum;

import javax.persistence.AttributeConverter;

/**
 * @author Miaoxia Yu
 * @date 2020-11-19
 */
public abstract class AbstractJpaEnumConverter& ValueEnum, V> extends AbstractEnumConverter implements AttributeConverter {

    protected AbstractJpaEnumConverter(Class clazz) {
        super(clazz);
    }

    @Override
    public V convertToDatabaseColumn(E e) {
        return super.reverseConvert(e);
    }

    @Override
    public E convertToEntityAttribute(V v) {
        return super.convert(v);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy