com.cedarsoft.gdao.AbstractInstanceFinder Maven / Gradle / Ivy
package com.cedarsoft.gdao;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
*
*/
public abstract class AbstractInstanceFinder extends AbstractFinder implements InstanceFinder {
protected AbstractInstanceFinder( @NotNull Class type ) {
super( type );
}
@Override
@Nullable
protected T execute( @NotNull Criteria criteria ) throws HibernateException {
return type.cast( criteria.uniqueResult() );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy