JPA-43 - Impl Index and ForeignKey for JPA 2.1

This commit is contained in:
Strong Liu 2013-02-28 23:19:11 +08:00
parent 51a7df596e
commit 0e6d08d414
2 changed files with 3 additions and 3 deletions

View File

@ -144,9 +144,9 @@ public class IndexTest extends BaseCoreFunctionalTestCase {
Bag set = (Bag)property.getValue(); Bag set = (Bag)property.getValue();
Table collectionTable = set.getCollectionTable(); Table collectionTable = set.getCollectionTable();
Iterator<UniqueKey> itr = collectionTable.getUniqueKeyIterator(); Iterator<Index> itr = collectionTable.getIndexIterator();
assertTrue( itr.hasNext() ); assertTrue( itr.hasNext() );
UniqueKey index = itr.next(); Index index = itr.next();
assertFalse( itr.hasNext() ); assertFalse( itr.hasNext() );
assertTrue( "index name is not generated", StringHelper.isNotEmpty( index.getName() ) ); assertTrue( "index name is not generated", StringHelper.isNotEmpty( index.getName() ) );
assertEquals( 1, index.getColumnSpan() ); assertEquals( 1, index.getColumnSpan() );

View File

@ -69,7 +69,7 @@ public class Alias implements Identifiable {
} }
@ManyToMany( cascade = CascadeType.ALL ) @ManyToMany( cascade = CascadeType.ALL )
@JoinTable( name = "CHARACTER_ALIAS", indexes = @Index( columnList = "characters_id", unique = true)) @JoinTable( name = "CHARACTER_ALIAS", indexes = @Index( columnList = "characters_id"))
// @JoinTable( // @JoinTable(
// name = "CHARACTER_ALIAS", // name = "CHARACTER_ALIAS",
// joinColumns = @JoinColumn(name="ALIAS_ID", referencedColumnName="ID"), // joinColumns = @JoinColumn(name="ALIAS_ID", referencedColumnName="ID"),