Hibernate ORM QueryKey - 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 QueryKey class.

This code example shows how to use the following methods:getResultTransformer
 
	private void doTest(QueryKey key) {
		Map keyMap = new HashMap();
		Map transformerMap = new HashMap();
 
		keyMap.put( key, "" );
		assert keyMap.size() == 1 : "really messed up";
		Object old = keyMap.put( key, "value" );
		assert old != null && keyMap.size() == 1 : "apparent QueryKey equals/hashCode issue";
 
		if ( key.getResultTransformer() != null ) {
			transformerMap.put( key.getResultTransformer(), "" );
			assert transformerMap.size() == 1 : "really messed up";
			old = transformerMap.put( key.getResultTransformer(), "value" );
			assert old != null && transformerMap.size() == 1 : "apparent QueryKey equals/hashCode issue";
		} 
 
		// finally, lets serialize it and see what happens 
		QueryKey key2 = ( QueryKey ) SerializationHelper.clone( key );
		assert key != key2 : "deep copy issue";

5
CodeRank
See Code Examples for Hibernate ORM QueryKey Methods: