Example usage for org.hibernate.criterion Property isNull

List of usage examples for org.hibernate.criterion Property isNull

Introduction

In this page you can find the example usage for org.hibernate.criterion Property isNull.

Prototype

public Criterion isNull() 

Source Link

Document

Creates a NULL restriction

Usage

From source file:io.github.jonestimd.finance.dao.hibernate.AccountDaoImpl.java

License:Open Source License

public Account getAccount(Company company, String name) {
    Property companyProperty = getProperty(Account.COMPANY);
    Criterion companyCriterion = company == null ? companyProperty.isNull() : companyProperty.eq(company);
    return findUnique(companyCriterion, Restrictions.eq(Account.NAME, name));
}