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

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

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

import tech.simter.persistence.CommonState;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

/**
 * A {@link CommonState} {@link AttributeConverter} implementation that used to convert
 * entity attribute state into database column representation and back again.
 *
 * @author dragon 2017-04-28
 */
@Converter(autoApply = true)
public class CommonStateConverter extends PersistenceEnumConverter {
  @Override
  public CommonState convertToEntityAttribute(Integer dbData) {
    return CommonState.valueOf(dbData);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy