1 package org.hibernate.mapping; 3 4 import org.hibernate.MappingException; 5 import org.hibernate.type.CollectionType; 6 import org.hibernate.type.TypeFactory; 7 8 12 public class Map extends IndexedCollection { 13 14 public Map(PersistentClass owner) { 15 super(owner); 16 } 17 18 public boolean isMap() { 19 return true; 20 } 21 22 public CollectionType getDefaultCollectionType() { 23 return isSorted() ? 24 TypeFactory.sortedMap( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() ) : 25 TypeFactory.map( getRole(), getReferencedPropertyName(), isEmbedded() ); 26 } 27 28 29 public void createAllKeys() throws MappingException { 30 super.createAllKeys(); 31 if ( !isInverse() ) getIndex().createForeignKey(); 32 } 33 34 public Object accept(ValueVisitor visitor) { 35 return visitor.accept(this); 36 } 37 } 38 | Popular Tags |