01: //$Id: Loadable.java 7458 2005-07-12 20:12:57Z oneovthafew $
02: package org.hibernate.persister.entity;
03:
04: import java.io.Serializable;
05: import java.sql.ResultSet;
06: import java.sql.SQLException;
07:
08: import org.hibernate.HibernateException;
09: import org.hibernate.engine.SessionImplementor;
10: import org.hibernate.type.Type;
11:
12: /**
13: * Implemented by a <tt>EntityPersister</tt> that may be loaded
14: * using <tt>Loader</tt>.
15: *
16: * @see org.hibernate.loader.Loader
17: * @author Gavin King
18: */
19: public interface Loadable extends EntityPersister {
20:
21: public static final String ROWID_ALIAS = "rowid_";
22:
23: /**
24: * Does this persistent class have subclasses?
25: */
26: public boolean hasSubclasses();
27:
28: /**
29: * Get the discriminator type
30: */
31: public Type getDiscriminatorType();
32:
33: /**
34: * Get the concrete subclass corresponding to the given discriminator
35: * value
36: */
37: public String getSubclassForDiscriminatorValue(Object value);
38:
39: /**
40: * Get the names of columns used to persist the identifier
41: */
42: public String[] getIdentifierColumnNames();
43:
44: /**
45: * Get the result set aliases used for the identifier columns, given a suffix
46: */
47: public String[] getIdentifierAliases(String suffix);
48:
49: /**
50: * Get the result set aliases used for the property columns, given a suffix (properties of this class, only).
51: */
52: public String[] getPropertyAliases(String suffix, int i);
53:
54: /**
55: * Get the result set column names mapped for this property (properties of this class, only).
56: */
57: public String[] getPropertyColumnNames(int i);
58:
59: /**
60: * Get the result set aliases used for the identifier columns, given a suffix
61: */
62: public String getDiscriminatorAlias(String suffix);
63:
64: /**
65: * @return the column name for the discriminator as specified in the mapping.
66: */
67: public String getDiscriminatorColumnName();
68:
69: /**
70: * Does the result set contain rowids?
71: */
72: public boolean hasRowId();
73:
74: /**
75: * Retrieve property values from one row of a result set
76: */
77: public Object[] hydrate(ResultSet rs, Serializable id,
78: Object object, Loadable rootLoadable,
79: String[][] suffixedPropertyColumns, boolean allProperties,
80: SessionImplementor session) throws SQLException,
81: HibernateException;
82:
83: public boolean isAbstract();
84:
85: }
|