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

com.github.jnoee.xo.jpa.converter.ArrayConverter Maven / Gradle / Ivy

The newest version!
package com.github.jnoee.xo.jpa.converter;

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

import com.github.jnoee.xo.utils.StringUtils;

@Converter(autoApply = true)
public class ArrayConverter implements AttributeConverter {
  @Override
  public String convertToDatabaseColumn(String[] attribute) {
    return StringUtils.arrayToString(attribute);
  }

  @Override
  public String[] convertToEntityAttribute(String dbData) {
    return StringUtils.stringToArray(dbData);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy