com.databasesandlife.util.jooq.MySqlBooleanConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-common Show documentation
Show all versions of java-common Show documentation
Utility classes developed at Adrian Smith Software (A.S.S.)
package com.databasesandlife.util.jooq;
import org.jooq.Converter;
@SuppressWarnings({ "serial" })
public class MySqlBooleanConverter implements Converter {
@Override public Class fromType() { return Byte.class; }
@Override public Class toType() { return Boolean.class; }
@Override
public Boolean from(Byte x) {
if (x == null) return null;
if (x == (byte)0) return false;
return true;
}
@Override
public Byte to(Boolean m) {
if (m == null) return null;
return m ? (byte)1 : 0;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy