@@ -0,0 +1,1493 @@
+package dk.lessismore.nojpa.rest;%0A%0Aimport dk.lessismore.nojpa.reflection.db.model.ModelObjectInterface;%0Aimport org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory;%0Aimport org.springframework.core.convert.TypeDescriptor;%0Aimport org.springframework.core.convert.converter.GenericConverter;%0A%0Aimport java.util.LinkedHashSet;%0Aimport java.util.Set;%0A%0A/**%0A * Created by niakoi on 12/3/15.%0A */%0Apublic class NoJpaConverter implements GenericConverter %7B%0A%0A    protected Log log = LogFactory.getLog(getClass());%0A%0A    private NoJpaFormatter formatter;%0A%0A    public NoJpaConverter(NoJpaFormatter formatter) %7B%0A        this.formatter = formatter;%0A    %7D%0A%0A    @Override%0A    public Set%3CConvertiblePair%3E getConvertibleTypes() %7B%0A        Set%3CConvertiblePair%3E pairs = new LinkedHashSet%3CConvertiblePair%3E(2);%0A        pairs.add(new ConvertiblePair(formatter.getClazz(), String.class));%0A        pairs.add(new ConvertiblePair(String.class, formatter.getClazz()));%0A        return pairs;%0A    %7D%0A%0A    @Override%0A    public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) %7B%0A        try %7B%0A            if (sourceType.getType().equals(String.class)) %7B%0A                return formatter.parse((String) source, null);%0A            %7D else %7B%0A                return formatter.print((ModelObjectInterface) source, null);%0A            %7D%0A        %7D catch (Exception e) %7B%0A            log.warn(%22cant convert %22 + source + %22 to %22 + targetType, e);%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

implement Converter interface for link generation