check( true, aliasEntityNameLockMode, new NativeSQLQueryRootReturn( "abc", "Person", LockMode.NONE ) );
check( true, aliasEntityNameDiffLockMode, new NativeSQLQueryRootReturn( "abc", "Person", LockMode.OPTIMISTIC ) );
}
public void testNativeSQLQueryJoinReturn() {
NativeSQLQueryJoinReturn r1 = new NativeSQLQueryJoinReturn( "a", "b", "c", null, null);
NativeSQLQueryJoinReturn r2 = new NativeSQLQueryJoinReturn( "a", "c", "b", null, null);
NativeSQLQueryJoinReturn r3NullMap = new NativeSQLQueryJoinReturn( "b", "c", "a", null, null);
NativeSQLQueryJoinReturn r3EmptyMap= new NativeSQLQueryJoinReturn( "b", "c", "a", new HashMap(), null);
NativeSQLQueryJoinReturn r4 = new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), null);
NativeSQLQueryJoinReturn r5 = new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "otherkey", "othervalue" ), null);
NativeSQLQueryJoinReturn r6 = new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE );
NativeSQLQueryJoinReturn r7 = new NativeSQLQueryJoinReturn( "b", "c", "a", null, LockMode.NONE );
check( false, r1, r2 );
check( false, r1, r3NullMap );
check( false, r1, r3EmptyMap );
check( false, r1, r4 );
check( false, r1, r5 );
check( false, r1, r6 );
check( false, r1, r7 );
check( false, r2, r3NullMap );
check( false, r2, r3EmptyMap );
check( false, r2, r4 );
check( false, r2, r5 );
check( false, r2, r6 );
check( false, r2, r7 );
check( true, r3NullMap, r3EmptyMap );
check( false, r3NullMap, r4 );
check( false, r3NullMap, r5 );
check( false, r3NullMap, r6 );
check( false, r3NullMap, r7 );
check( false, r3EmptyMap, r4 );
check( false, r3EmptyMap, r5 );
check( false, r3EmptyMap, r6 );
check( false, r3EmptyMap, r7 );
check( false, r4, r5 );
check( false, r4, r6 );
check( false, r4, r7 );
check( false, r5, r6 );
check( false, r5, r7 );
check( false, r6, r7 );
check( true, r1, new NativeSQLQueryJoinReturn( "a", "b", "c", null, null) );
check( true, r2, new NativeSQLQueryJoinReturn( "a", "c", "b", null, null) );
check( true, r3NullMap, new NativeSQLQueryJoinReturn( "b", "c", "a", null, null) );
check( true, r3EmptyMap, new NativeSQLQueryJoinReturn( "b", "c", "a", new HashMap(), null) );
check( true, r4, new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), null) );
check( true, r5, new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "otherkey", "othervalue" ), null) );
check( true, r6, new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE ) );
check( true, r7, new NativeSQLQueryJoinReturn( "b", "c", "a", null, LockMode.NONE ) );
}