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

io.github.kbachilo.jooq.converter.DateConverter Maven / Gradle / Ivy

package io.github.kbachilo.jooq.converter;

import org.jooq.Converter;

import java.sql.Date;
import java.util.Objects;

public class DateConverter implements Converter {

    public Date from(Date databaseObject) {
        return Objects.isNull(databaseObject) ? null : new Date(databaseObject.getTime());
    }

    public Date to(Date userObject) {
        return Objects.isNull(userObject) ? null : new Date(userObject.getTime());
    }

    public Class fromType() {
        return Date.class;
    }

    public Class toType() {
        return Date.class;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy