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

com.cedarsoft.gdao.AbstractInstanceFinder Maven / Gradle / Ivy

There is a newer version: 1.3.7
Show newest version
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