KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > type > AssociationType


1 //$Id: AssociationType.java,v 1.12 2005/06/05 04:31:34 oneovthafew Exp $
2
package org.hibernate.type;
3
4 import org.hibernate.MappingException;
5 import org.hibernate.engine.SessionFactoryImplementor;
6 import org.hibernate.persister.entity.Joinable;
7
8 import java.util.Map JavaDoc;
9
10 /**
11  * A type that represents some kind of association between entities.
12  * @see org.hibernate.engine.Cascade
13  * @author Gavin King
14  */

15 public interface AssociationType extends Type {
16
17     /**
18      * Get the foreign key directionality of this association
19      */

20     public ForeignKeyDirection getForeignKeyDirection();
21
22     //TODO: move these to a new JoinableType abstract class,
23
//extended by EntityType and PersistentCollectionType:
24

25     /**
26      * Is the primary key of the owning entity table
27      * to be used in the join?
28      */

29     public boolean useLHSPrimaryKey();
30     /**
31      * Get the name of a property in the owning entity
32      * that provides the join key (null if the identifier)
33      */

34     public String JavaDoc getLHSPropertyName();
35     
36     /**
37      * The name of a unique property of the associated entity
38      * that provides the join key (null if the identifier of
39      * an entity, or key of a collection)
40      */

41     public String JavaDoc getRHSUniqueKeyPropertyName();
42
43     /**
44      * Get the "persister" for this association - a class or
45      * collection persister
46      */

47     public Joinable getAssociatedJoinable(SessionFactoryImplementor factory) throws MappingException;
48     
49     /**
50      * Get the entity name of the associated entity
51      */

52     public String JavaDoc getAssociatedEntityName(SessionFactoryImplementor factory) throws MappingException;
53     
54     /**
55      * Get the "filtering" SQL fragment that is applied in the
56      * SQL on clause, in addition to the usual join condition
57      */

58     public String JavaDoc getOnCondition(String JavaDoc alias, SessionFactoryImplementor factory, Map JavaDoc enabledFilters)
59     throws MappingException;
60     
61     /**
62      * Do we dirty check this association, even when there are
63      * no columns to be updated?
64      */

65     public abstract boolean isAlwaysDirtyChecked();
66     
67     public boolean isEmbeddedInXML();
68 }
69
70
71
72
73
74
75
Popular Tags