Hibernate ORM BasicTransformerAdapter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM BasicTransformerAdapter class.

This code example shows how to use the following methods:
     *  
     */ 
    private static final long serialVersionUID = -3530890859099882786L;
    Map _aliases;
 
    HierarchyToMapTransformer(Map aliases) {
        this._aliases = aliases;
    } 
 
    @Override 
    public Object transformTuple(Object[] tuple, String[] aliases) {
        Map result = new HashMap();
        for (int i = 0; i < tuple.length; i++) {
            String alias = aliases[i];
            if (alias != null && _aliases.containsKey(alias)) {
                result.put(_aliases.get(alias), tuple[i]);
            } 
        } 
        return result;
    } 
5
CodeRank
This code example shows how to use the following methods:
	private byte mask(boolean on) {
		return on ? ( byte ) 1 : ( byte ) 0;
	} 
 
	@SuppressWarnings( {"unchecked"}) 
	private static class UpperCasedAliasToEntityMapResultTransformer extends BasicTransformerAdapter implements Serializable {
		public Object transformTuple(Object[] tuple, String[] aliases) {
			Map result = new HashMap( tuple.length );
			for ( int i = 0; i < tuple.length; i++ ) {
				String alias = aliases[i];
				if ( alias != null ) {
					result.put( alias.toUpperCase(), tuple[i] );
				} 
			} 
			return result;
		} 
	} 
} 
3
CodeRank