public static String[] suffix(String[] columns, String suffix) { if ( suffix == null ) return columns; String[] qualified = new String[columns.length]; for ( int i = 0; i < columns.length; i++ ) { qualified[i] = suffix( columns[i], suffix ); } return qualified; }
public static String[] suffix(String[] columns, String suffix) { if ( suffix == null ) return columns; String[] qualified = new String[columns.length]; for ( int i = 0; i < columns.length; i++ ) { qualified[i] = suffix( columns[i], suffix ); } return qualified; }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return StringHelper.join( " and ", StringHelper.suffix( criteriaQuery.getColumnsUsingProjection(criteria, propertyName), " between ? and ?" ) ); //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return StringHelper.join( " and ", StringHelper.suffix( criteriaQuery.getColumnsUsingProjection(criteria, propertyName), " between ? and ?" ) ); //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); String result = StringHelper.join( " or ", StringHelper.suffix( columns, " is not null" ) ); if (columns.length>1) result = '(' + result + ')'; return result; //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); String result = StringHelper.join( " or ", StringHelper.suffix( columns, " is not null" ) ); if (columns.length>1) result = '(' + result + ')'; return result; //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getIdentifierColumns(criteria); String result = StringHelper.join( " and ", StringHelper.suffix( columns, " = ?" ) ); if (columns.length>1) result = '(' + result + ')'; return result; //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); String result = StringHelper.join( " and ", StringHelper.suffix( columns, " is null" ) ); if (columns.length>1) result = '(' + result + ')'; return result; //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); String result = StringHelper.join( " and ", StringHelper.suffix( columns, " is null" ) ); if (columns.length>1) result = '(' + result + ')'; return result; //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getIdentifierColumns(criteria); String result = StringHelper.join( " and ", StringHelper.suffix( columns, " = ?" ) ); if (columns.length>1) result = '(' + result + ')'; return result; //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); if (ignoreCase) { if ( columns.length!=1 ) throw new HibernateException( "case insensitive expression may only be applied to single-column properties: " + propertyName ); return new StringBuffer() .append( criteriaQuery.getFactory().getDialect().getLowercaseFunction() ) .append('(') .append( columns[0] ) .append(')') .append( getOp() ) .append("?") .toString(); } else { String result = StringHelper.join( " and ", StringHelper.suffix( columns, getOp() + "?" ) ); if (columns.length>1) result = '(' + result + ')'; return result; } //TODO: get SQL rendering out of this package! }
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { String params; if ( values.length>0 ) { params = StringHelper.repeat( "?, ", values.length-1 ); params += "?"; } else { params = ""; } String condition = " in (" + params + ')'; return StringHelper.join( " and ", StringHelper.suffix( criteriaQuery.getColumnsUsingProjection(criteria, propertyName), condition ) ); //TODO: get SQL rendering out of this package! }