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

tech.simter.jpa.ext.PersistenceEnumConverter Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package tech.simter.jpa.ext;

import tech.simter.persistence.PersistenceEnum;

import javax.persistence.AttributeConverter;

/**
 * Abstract class for convert entity attribute state into database column.
 *
 * @param  the type of the entity attribute
 * @param  the type of the database column
 * @author dragon 2017-04-28
 */
public abstract class PersistenceEnumConverter, V> implements AttributeConverter {
  @Override
  public V convertToDatabaseColumn(E attribute) {
    return attribute == null ? null : attribute.value();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy