package net.sourceforge.fenixedu.persistenceTier.Conversores; import org.apache.ojb.broker.accesslayer.conversions.ConversionException; import org.apache.ojb.broker.accesslayer.conversions.FieldConversion; import pt.utl.ist.fenix.tools.util.i18n.Language; public class Language2SqlConversion implements FieldConversion { /** * Serial version id. */ private static final long serialVersionUID = 1L; public Object javaToSql(Object source) throws ConversionException { if (source == null) { return null; } else { return ((Language) source).name(); } } public Object sqlToJava(Object source) throws ConversionException { if (source == null) { return null; } else { return Language.valueOf((String) source); } } }