jpa/src/main/java/de/taimos/dvalin/jpa/EntityDAOHibernate.java
/**
     * @param query the JPA query
     * @param params the positional parameters
     * @return the entity or null if not found or more than one found
     */
@param query the JPA query
@param params the positional parameters
@return the entity or null if not found or more than one found
@param query the JPA query @param params the positional parameters @return the entity or null if not found or more than one found
protected final Object[] findGenericByQuery(final String query, final Object... params) {
        final List<Object[]> list = this.findGenericListByQuery(query, params);
        if (list.size() == 1) {
            return list.get(0);
        }
        return null;
    }
protected final Object [ ] findGenericByQuery ( final String query , final Object ... params ) { final List < Object [ ] > list = this . findGenericListByQuery ( query , params ) ; if ( list . size ( ) == 1 ) { return list . get ( 0 ) ; } return null ; }
@param query the JPA query
 @param params the positional parameters
 @return the entity or null if not found or more than one found
@param query the JPA query @param params the positional parameters @return the entity or null if not found or more than one found