From: <one...@us...> - 2002-11-26 03:35:47
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv20166/cirrus/hibernate/persister Modified Files: AbstractEntityPersister.java Loadable.java Queryable.java Log Message: fixed broken line-endings and added a test Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AbstractEntityPersister.java 25 Nov 2002 05:18:00 -0000 1.15 --- AbstractEntityPersister.java 26 Nov 2002 03:35:44 -0000 1.16 *************** *** 1,706 **** ! //$Id$ ! package cirrus.hibernate.persister; ! ! import java.io.Serializable; ! import java.lang.reflect.Constructor; ! import java.lang.reflect.Method; ! import java.util.HashMap; ! import java.util.HashSet; ! import java.util.Iterator; ! [...1383 lines suppressed...] ! ! StringBuffer aliasBuilder = new StringBuffer(name.length()); ! ! if (nameEscaped) aliasBuilder.append(quote); ! aliasBuilder.append(name); ! aliasBuilder.append(suffix); ! if (nameEscaped) aliasBuilder.append(quote); ! ! return aliasBuilder.toString(); ! } ! ! public Class getMappedSuperclass() { ! return superclass; ! } ! ! public boolean isExplicitPolymorphism() { ! return explicitPolymorphism; ! } ! ! } Index: Loadable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/Loadable.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Loadable.java 25 Nov 2002 07:25:20 -0000 1.13 --- Loadable.java 26 Nov 2002 03:35:44 -0000 1.14 *************** *** 1,107 **** ! //$Id$ ! package cirrus.hibernate.persister; ! ! import cirrus.hibernate.type.DiscriminatorType; ! import cirrus.hibernate.type.Type; ! ! /** ! * Implemented by a <tt>ClassPersister</tt> that uses <tt>Loader</tt>. There are several optional ! * operations used only by loaders that inherit <tt>OuterJoinLoader</tt>. ! * ! * @see cirrus.hibernate.loader.Loader ! * @see cirrus.hibernate.loader.OuterJoinLoader ! */ ! public interface Loadable extends ClassPersister { ! ! /** ! * Get the names of columns used to persist the identifier ! */ ! public String[] getIdentifierColumnNames(); ! ! /** ! * Does this persistent class have subclasses? ! */ ! public boolean hasSubclasses(); ! ! /** ! * Get the name of the column used as a discriminator ! */ ! public String getDiscriminatorColumnName(); ! ! /** ! * Get the discriminator type ! */ ! public DiscriminatorType getDiscriminatorType(); ! ! /** ! * Get the concrete subclass corresponding to the given discriminator ! * value ! */ ! public Class getSubclassForDiscriminatorValue(Object value); ! ! /** ! * Get the column names for the numbered property of <em>this</em> class ! */ ! public String[] getPropertyColumnNames(int i); ! ! //USED BY OuterJoinLoader + subclasses ! ! /** ! * Get the fully-qualified tablename used to persist this class ! */ ! public String getTableName(); ! ! /** ! * How many properties are there, for this class and all subclasses? ! * (optional operation) ! */ ! public int countSubclassProperties(); ! ! /** ! * May this property be fetched using an SQL outerjoin? ! * (optional operation) ! */ ! public int enableJoinedFetch(int i); ! ! /** ! * Is this property defined on a subclass of the mapped class? ! */ ! public boolean isDefinedOnSubclass(int i); ! ! /** ! * Get an array of the types of all properties of all subclasses ! * (optional operation) ! */ ! public Type getSubclassPropertyType(int i); ! ! /** ! * Return the column names used to persist all properties of ! * all subclasses of the persistent class ! * (optional operation) ! */ ! public String[] getSubclassPropertyColumnNames(int i); ! /** ! * Given the number of a property of a subclass, and a table alias, ! * return the aliased column names ! */ ! public String[] toColumns(String name, int i); ! ! /** ! * Given a query alias and an identifying suffix, render the ! * property select fragment ! */ ! public String propertySelectClauseFragment(String name, String suffix); ! /** ! * Get the from clause fragment, given a query alias ! */ ! public String fromClauseFragment(String name, boolean innerJoin); ! /** ! * Get any the outer join SQL fragments that appear in the <tt>FROM</tt> clause ! */ ! public String outerJoinsAfterFrom(String name, boolean innerJoin); ! /** ! * Get any the outer join SQL fragments that appear in the <tt>WHERE</tt> clause ! */ ! public String outerJoinsAfterWhere(String name, boolean innerJoin); ! ! } --- 1,107 ---- ! //$Id$ ! package cirrus.hibernate.persister; ! ! import cirrus.hibernate.type.DiscriminatorType; ! import cirrus.hibernate.type.Type; ! ! /** ! * Implemented by a <tt>ClassPersister</tt> that uses <tt>Loader</tt>. There are several optional ! * operations used only by loaders that inherit <tt>OuterJoinLoader</tt>. ! * ! * @see cirrus.hibernate.loader.Loader ! * @see cirrus.hibernate.loader.OuterJoinLoader ! */ ! public interface Loadable extends ClassPersister { ! ! /** ! * Get the names of columns used to persist the identifier ! */ ! public String[] getIdentifierColumnNames(); ! ! /** ! * Does this persistent class have subclasses? ! */ ! public boolean hasSubclasses(); ! ! /** ! * Get the name of the column used as a discriminator ! */ ! public String getDiscriminatorColumnName(); ! ! /** ! * Get the discriminator type ! */ ! public DiscriminatorType getDiscriminatorType(); ! ! /** ! * Get the concrete subclass corresponding to the given discriminator ! * value ! */ ! public Class getSubclassForDiscriminatorValue(Object value); ! ! /** ! * Get the column names for the numbered property of <em>this</em> class ! */ ! public String[] getPropertyColumnNames(int i); ! ! //USED BY OuterJoinLoader + subclasses ! ! /** ! * Get the fully-qualified tablename used to persist this class ! */ ! public String getTableName(); ! ! /** ! * How many properties are there, for this class and all subclasses? ! * (optional operation) ! */ ! public int countSubclassProperties(); ! ! /** ! * May this property be fetched using an SQL outerjoin? ! * (optional operation) ! */ ! public int enableJoinedFetch(int i); ! ! /** ! * Is this property defined on a subclass of the mapped class? ! */ ! public boolean isDefinedOnSubclass(int i); ! ! /** ! * Get an array of the types of all properties of all subclasses ! * (optional operation) ! */ ! public Type getSubclassPropertyType(int i); ! ! /** ! * Return the column names used to persist all properties of ! * all subclasses of the persistent class ! * (optional operation) ! */ ! public String[] getSubclassPropertyColumnNames(int i); ! /** ! * Given the number of a property of a subclass, and a table alias, ! * return the aliased column names ! */ ! public String[] toColumns(String name, int i); ! ! /** ! * Given a query alias and an identifying suffix, render the ! * property select fragment ! */ ! public String propertySelectClauseFragment(String name, String suffix); ! /** ! * Get the from clause fragment, given a query alias ! */ ! public String fromClauseFragment(String name, boolean innerJoin); ! /** ! * Get any the outer join SQL fragments that appear in the <tt>FROM</tt> clause ! */ ! public String outerJoinsAfterFrom(String name, boolean innerJoin); ! /** ! * Get any the outer join SQL fragments that appear in the <tt>WHERE</tt> clause ! */ ! public String outerJoinsAfterWhere(String name, boolean innerJoin); ! ! } Index: Queryable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/Queryable.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Queryable.java 19 Nov 2002 10:42:17 -0000 1.9 --- Queryable.java 26 Nov 2002 03:35:44 -0000 1.10 *************** *** 1,58 **** ! //$Id$ ! package cirrus.hibernate.persister; ! ! import cirrus.hibernate.MappingException; ! import cirrus.hibernate.QueryException; ! import cirrus.hibernate.type.Type; ! ! /** ! * Extends the generic <tt>ClassPersister</tt> contract to add ! * operations required by the query language ! */ ! public interface Queryable extends Loadable { ! ! /** ! * Is this class mapped as a subclass of another class? ! */ ! public boolean isInherited(); ! /** ! * Is this class explicit polymorphism only? ! */ ! public boolean isExplicitPolymorphism(); ! /** ! * Get the class that this class is mapped as a subclass of - ! * not necessarily the direct superclass ! */ ! public Class getMappedSuperclass(); ! /** ! * Get the discriminator value for this particular concrete subclass, ! * as a string that may be embedded in a select statement ! */ ! public String getDiscriminatorSQLString(); ! ! /** ! * Given a component path expression, get the type of the property ! */ ! public Type getPropertyType(String path); ! /** ! * Given a component path expression, get the type of the composite ! * identifier property ! */ ! public Type getIdentifierPropertyType(String path); ! ! /** ! * Get the where clause fragment, given a query alias ! */ ! public String getQueryWhereClause(String name) throws MappingException; ! ! /** ! * Given a query alias and an identifying suffix, render the ! * intentifier select fragment ! */ ! public String selectIdentifierString(String name, String suffix); ! /** ! * Given a query alias and a property path, return the qualified ! * column name ! */ ! public String[] toColumns(String name, String property) throws QueryException; ! } --- 1,58 ---- ! //$Id$ ! package cirrus.hibernate.persister; ! ! import cirrus.hibernate.MappingException; ! import cirrus.hibernate.QueryException; ! import cirrus.hibernate.type.Type; ! ! /** ! * Extends the generic <tt>ClassPersister</tt> contract to add ! * operations required by the query language ! */ ! public interface Queryable extends Loadable { ! ! /** ! * Is this class mapped as a subclass of another class? ! */ ! public boolean isInherited(); ! /** ! * Is this class explicit polymorphism only? ! */ ! public boolean isExplicitPolymorphism(); ! /** ! * Get the class that this class is mapped as a subclass of - ! * not necessarily the direct superclass ! */ ! public Class getMappedSuperclass(); ! /** ! * Get the discriminator value for this particular concrete subclass, ! * as a string that may be embedded in a select statement ! */ ! public String getDiscriminatorSQLString(); ! ! /** ! * Given a component path expression, get the type of the property ! */ ! public Type getPropertyType(String path); ! /** ! * Given a component path expression, get the type of the composite ! * identifier property ! */ ! public Type getIdentifierPropertyType(String path); ! ! /** ! * Get the where clause fragment, given a query alias ! */ ! public String getQueryWhereClause(String name) throws MappingException; ! ! /** ! * Given a query alias and an identifying suffix, render the ! * intentifier select fragment ! */ ! public String selectIdentifierString(String name, String suffix); ! /** ! * Given a query alias and a property path, return the qualified ! * column name ! */ ! public String[] toColumns(String name, String property) throws QueryException; ! } |