Rebuild the full mapping from persistence-jpa-1.5.1 to reproduce the bug
[jpa-converters] / src / test / java / de / juplo / yourshouter / api / persistence / jpa / StringFeatureConverter.java
1 package de.juplo.yourshouter.api.persistence.jpa;
2
3 import de.juplo.yourshouter.api.model.Feature;
4 import de.juplo.yourshouter.api.storage.Storage;
5 import javax.persistence.AttributeConverter;
6
7
8 /**
9  *
10  * @author kai
11  */
12 public class StringFeatureConverter
13     implements
14       AttributeConverter<Feature, String>
15 {
16   @Override
17   public String convertToDatabaseColumn(Feature feature)
18   {
19     if (feature == null)
20       return null;
21     return feature.getName();
22   }
23
24   @Override
25   public Feature convertToEntityAttribute(String name)
26   {
27     if (name == null)
28       return null;
29     return new Feature(Storage.getSource(), name);
30   }
31 }