|
From: <one...@us...> - 2003-01-04 11:23:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister
In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/persister
Modified Files:
AbstractEntityPersister.java ClassPersister.java
EntityPersister.java Loadable.java
MultiTableEntityPersister.java Queryable.java
Log Message:
reformatted code with beautiful, shiny, happy TABS!
improved an exception
Index: AbstractEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AbstractEntityPersister.java 1 Jan 2003 13:56:33 -0000 1.1.1.1
--- AbstractEntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2
***************
*** 52,64 ****
private static final Log log = LogFactory.getLog(AbstractEntityPersister.class);
!
protected static final Class[] NO_CLASSES = new Class[0];
!
private final Class mappedClass;
! protected transient final Dialect dialect;
private transient final Constructor constructor;
!
private transient final IdentifierGenerator idgen;
private transient final boolean polymorphic;
--- 52,64 ----
private static final Log log = LogFactory.getLog(AbstractEntityPersister.class);
!
protected static final Class[] NO_CLASSES = new Class[0];
!
private final Class mappedClass;
! protected transient final Dialect dialect;
private transient final Constructor constructor;
!
private transient final IdentifierGenerator idgen;
private transient final boolean polymorphic;
***************
*** 75,94 ****
private transient final boolean useIdentityColumn;
private transient final Class superclass;
!
! private transient final String identitySelectString;
!
! private transient final Class[] proxyInterfaces;
! private transient final Class concreteProxyClass;
! private transient final boolean hasProxy;
private transient final boolean hasEmbeddedIdentifier;
private transient final String[] identifierColumnNames;
private transient final Cascades.IdentifierValue unsavedIdentifierValue;
!
private transient final HashMap idTypesByPropertyPath = new HashMap();
private transient final HashMap idColumnNamesByPropertyPath = new HashMap();
protected transient final HashMap columnNamesByPropertyPath = new HashMap();
protected transient final HashMap typesByPropertyPath = new HashMap();
!
private transient final String identifierPropertyName;
private transient final Type identifierType;
--- 75,94 ----
private transient final boolean useIdentityColumn;
private transient final Class superclass;
!
! private transient final String identitySelectString;
!
! private transient final Class[] proxyInterfaces;
! private transient final Class concreteProxyClass;
! private transient final boolean hasProxy;
private transient final boolean hasEmbeddedIdentifier;
private transient final String[] identifierColumnNames;
private transient final Cascades.IdentifierValue unsavedIdentifierValue;
!
private transient final HashMap idTypesByPropertyPath = new HashMap();
private transient final HashMap idColumnNamesByPropertyPath = new HashMap();
protected transient final HashMap columnNamesByPropertyPath = new HashMap();
protected transient final HashMap typesByPropertyPath = new HashMap();
!
private transient final String identifierPropertyName;
private transient final Type identifierType;
***************
*** 96,103 ****
private transient final ReflectHelper.Getter identifierGetter;
private transient final Method proxyGetIdentifierMethod;
!
private transient final String[] propertyNames;
private transient final Type[] propertyTypes;
!
private transient final String versionPropertyName;
private transient final String versionColumnName;
--- 96,103 ----
private transient final ReflectHelper.Getter identifierGetter;
private transient final Method proxyGetIdentifierMethod;
!
private transient final String[] propertyNames;
private transient final Type[] propertyTypes;
!
private transient final String versionPropertyName;
private transient final String versionColumnName;
***************
*** 113,117 ****
private transient final Cascades.CascadeStyle[] cascadeStyles;
! private transient final CacheConcurrencyStrategy cache;
public final Class getMappedClass() {
--- 113,117 ----
private transient final Cascades.CascadeStyle[] cascadeStyles;
! private transient final CacheConcurrencyStrategy cache;
public final Class getMappedClass() {
***************
*** 128,135 ****
for (int i=0; i<cols.length; i++) {
buf.append(name)
! .append('.')
! .append( cols[i] )
! .append(" as ")
! .append( aliasColumn(cols[i], suffix) );
if (i!=cols.length-1) buf.append(", ");
}
--- 128,135 ----
for (int i=0; i<cols.length; i++) {
buf.append(name)
! .append('.')
! .append( cols[i] )
! .append(" as ")
! .append( aliasColumn(cols[i], suffix) );
if (i!=cols.length-1) buf.append(", ");
}
***************
*** 148,166 ****
String idprop = getIdentifierPropertyName();
! if (
! PathExpressionParser.ENTITY_ID.equals(path) ||
! ( idprop!=null && path.equals(idprop) )
){
cols = getIdentifierColumnNames();
}
! else if (
! path.startsWith(PathExpressionParser.ENTITY_ID + '.') ||
( idprop!=null && path.startsWith(idprop + '.') )
) {
int loc = path.indexOf(".");
! String componentPath = path.substring(loc+1);
!
if ( getIdentifierType().isComponentType() ) {
cols = getIdentifierPropertyColumnNames(componentPath);
--- 148,166 ----
String idprop = getIdentifierPropertyName();
! if (
! PathExpressionParser.ENTITY_ID.equals(path) ||
! ( idprop!=null && path.equals(idprop) )
){
cols = getIdentifierColumnNames();
}
! else if (
! path.startsWith(PathExpressionParser.ENTITY_ID + '.') ||
( idprop!=null && path.startsWith(idprop + '.') )
) {
int loc = path.indexOf(".");
! String componentPath = path.substring(loc+1);
!
if ( getIdentifierType().isComponentType() ) {
cols = getIdentifierPropertyColumnNames(componentPath);
***************
*** 188,199 ****
String idprop = getIdentifierPropertyName();
! if (
! PathExpressionParser.ENTITY_ID.equals(path) ||
! ( idprop!=null && path.equals(idprop) )
){
return getIdentifierType();
! }
! else if (
! path.startsWith(PathExpressionParser.ENTITY_ID + '.') ||
( idprop!=null && path.startsWith(idprop + '.') )
) {
--- 188,199 ----
String idprop = getIdentifierPropertyName();
! if (
! PathExpressionParser.ENTITY_ID.equals(path) ||
! ( idprop!=null && path.equals(idprop) )
){
return getIdentifierType();
! }
! else if (
! path.startsWith(PathExpressionParser.ENTITY_ID + '.') ||
( idprop!=null && path.startsWith(idprop + '.') )
) {
***************
*** 209,214 ****
return cascadeStyles;
}
!
! /**
* Set the given values to the mapped properties of the given object
*/
--- 209,214 ----
return cascadeStyles;
}
!
! /**
* Set the given values to the mapped properties of the given object
*/
***************
*** 219,223 ****
}
! /**
* Return the values of the mapped properties of the object
*/
--- 219,223 ----
}
! /**
* Return the values of the mapped properties of the object
*/
***************
*** 307,311 ****
}
}
!
// Getters and Setters
--- 307,311 ----
}
}
!
// Getters and Setters
***************
*** 345,357 ****
return hasCascades;
}
!
public CacheConcurrencyStrategy getCache() {
return cache;
}
!
public boolean hasIdentifierProperty() {
return identifierGetter!=null;
}
!
public Method getProxyGetIdentifierMethod() {
return proxyGetIdentifierMethod;
--- 345,357 ----
return hasCascades;
}
!
public CacheConcurrencyStrategy getCache() {
return cache;
}
!
public boolean hasIdentifierProperty() {
return identifierGetter!=null;
}
!
public Method getProxyGetIdentifierMethod() {
return proxyGetIdentifierMethod;
***************
*** 372,384 ****
return useIdentityColumn;
}
!
public boolean isUnsaved(Serializable id) {
return unsavedIdentifierValue.isUnsaved(id);
}
!
public String[] getPropertyNames() {
return propertyNames;
}
!
public String getIdentifierPropertyName() {
return identifierPropertyName;
--- 372,384 ----
return useIdentityColumn;
}
!
public boolean isUnsaved(Serializable id) {
return unsavedIdentifierValue.isUnsaved(id);
}
!
public String[] getPropertyNames() {
return propertyNames;
}
!
public String getIdentifierPropertyName() {
return identifierPropertyName;
***************
*** 388,395 ****
return versionColumnName;
}
!
public final String[] getIdentifierPropertyColumnNames(String path) {
return (String[]) idColumnNamesByPropertyPath.get(path);
! }
public final Type getIdentifierPropertyType(String path) {
return (Type) idTypesByPropertyPath.get(path);
--- 388,395 ----
return versionColumnName;
}
!
public final String[] getIdentifierPropertyColumnNames(String path) {
return (String[]) idColumnNamesByPropertyPath.get(path);
! }
public final Type getIdentifierPropertyType(String path) {
return (Type) idTypesByPropertyPath.get(path);
***************
*** 402,410 ****
return implementsLifecycle;
}
!
public boolean implementsValidatable() {
return implementsValidatable;
}
!
public boolean hasCollections() {
return hasCollections;
--- 402,410 ----
return implementsLifecycle;
}
!
public boolean implementsValidatable() {
return implementsValidatable;
}
!
public boolean hasCollections() {
return hasCollections;
***************
*** 430,434 ****
return hasProxy;
}
!
/**
* The query that returns the generated identifier for an identity column
--- 430,434 ----
return hasProxy;
}
!
/**
* The query that returns the generated identifier for an identity column
***************
*** 440,457 ****
public IdentifierGenerator getIdentifierGenerator() throws HibernateException {
if (idgen==null) throw new HibernateException(
! "No ID SchemaExport is configured for class " +
! className +
" (Try using insert() with an assigned ID)"
);
return idgen;
}
!
protected void check(int rows, Serializable id) throws HibernateException {
! if (rows<1) {
! throw new StaleObjectStateException( getMappedClass(), id );
! }
! else if (rows>1) {
! throw new HibernateException( "Duplicate identifier in table for " + getClassName() + ": " + id );
! }
}
--- 440,457 ----
public IdentifierGenerator getIdentifierGenerator() throws HibernateException {
if (idgen==null) throw new HibernateException(
! "No ID SchemaExport is configured for class " +
! className +
" (Try using insert() with an assigned ID)"
);
return idgen;
}
!
protected void check(int rows, Serializable id) throws HibernateException {
! if (rows<1) {
! throw new StaleObjectStateException( getMappedClass(), id );
! }
! else if (rows>1) {
! throw new HibernateException( "Duplicate identifier in table for " + getClassName() + ": " + id );
! }
}
***************
*** 466,470 ****
mutable = model.isMutable();
!
polymorphic = model.isPolymorphic();
explicitPolymorphism = model.isExplicitPolymorphism();
--- 466,470 ----
mutable = model.isMutable();
!
polymorphic = model.isPolymorphic();
explicitPolymorphism = model.isExplicitPolymorphism();
***************
*** 472,476 ****
superclass = inherited ? model.getSuperclass().getPersistentClass() : null;
hasSubclasses = model.hasSubclasses();
!
constructor = ReflectHelper.getDefaultConstructor(mappedClass);
abstractClass = ReflectHelper.isAbstractClass(mappedClass);
--- 472,476 ----
superclass = inherited ? model.getSuperclass().getPersistentClass() : null;
hasSubclasses = model.hasSubclasses();
!
constructor = ReflectHelper.getDefaultConstructor(mappedClass);
abstractClass = ReflectHelper.isAbstractClass(mappedClass);
***************
*** 479,486 ****
hasEmbeddedIdentifier = model.hasEmbeddedIdentifier();
! identifierPropertyName = model.hasIdentifierProperty() ? model.getIdentifierProperty().getName() : null;
idgen = model.getIdentifier().getIdentifierGenerator();
Value idValue = model.getIdentifier();
! identifierType = idValue.getType();
if (identifierPropertyName!=null) {
--- 479,486 ----
hasEmbeddedIdentifier = model.hasEmbeddedIdentifier();
! identifierPropertyName = model.hasIdentifierProperty() ? model.getIdentifierProperty().getName() : null;
idgen = model.getIdentifier().getIdentifierGenerator();
Value idValue = model.getIdentifier();
! identifierType = idValue.getType();
if (identifierPropertyName!=null) {
***************
*** 502,506 ****
// HYDRATE SPAN
!
int m=0;
Iterator iter = model.getPropertyClosureIterator();
--- 502,506 ----
// HYDRATE SPAN
!
int m=0;
Iterator iter = model.getPropertyClosureIterator();
***************
*** 509,513 ****
}
hydrateSpan=m;
!
// IDENTIFIER
--- 509,513 ----
}
hydrateSpan=m;
!
// IDENTIFIER
***************
*** 523,528 ****
i++;
}
!
!
if ( idValue.isComposite() ) {
--- 523,528 ----
i++;
}
!
!
if ( idValue.isComposite() ) {
***************
*** 536,540 ****
Iterator colIter= prop.getColumnIterator();
int j=0;
! while ( colIter.hasNext() ) {
Column col = (Column) colIter.next();
cols[j++] = col.getName();
--- 536,540 ----
Iterator colIter= prop.getColumnIterator();
int j=0;
! while ( colIter.hasNext() ) {
Column col = (Column) colIter.next();
cols[j++] = col.getName();
***************
*** 548,586 ****
}
! }
-
IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator();
useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator );
identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null;
!
!
! // UNSAVED-VALUE:
!
! String cts = model.getIdentifier().getNullValue();
! if ( cts==null || "any".equals(cts) ) {
! unsavedIdentifierValue=Cascades.SAVE_ANY;
! }
! else if ( "none".equals(cts) ) {
! unsavedIdentifierValue=Cascades.SAVE_NONE;
! }
! else if ( "null".equals(cts) ) {
! unsavedIdentifierValue=Cascades.SAVE_NULL;
! }
else {
! try {
! unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) );
! }
catch (ClassCastException cce) {
throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() );
}
! catch (Exception e) {
! throw new MappingException("Could not parse unsaved-value: " + cts);
! }
}
!
! // VERSION:
!
! if ( model.isVersioned() ) {
versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName();
}
--- 548,586 ----
}
! }
!
IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator();
useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator );
identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null;
!
!
! // UNSAVED-VALUE:
!
! String cts = model.getIdentifier().getNullValue();
! if ( cts==null || "any".equals(cts) ) {
! unsavedIdentifierValue=Cascades.SAVE_ANY;
! }
! else if ( "none".equals(cts) ) {
! unsavedIdentifierValue=Cascades.SAVE_NONE;
! }
! else if ( "null".equals(cts) ) {
! unsavedIdentifierValue=Cascades.SAVE_NULL;
! }
else {
! try {
! unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) );
! }
catch (ClassCastException cce) {
throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() );
}
! catch (Exception e) {
! throw new MappingException("Could not parse unsaved-value: " + cts);
! }
}
!
! // VERSION:
!
! if ( model.isVersioned() ) {
versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName();
}
***************
*** 609,618 ****
setters = new ReflectHelper.Setter[hydrateSpan];
cascadeStyles = new Cascades.CascadeStyle[hydrateSpan];
!
iter = model.getPropertyClosureIterator();
i=0;
int tempVersionProperty=-66;
boolean foundCascade = false;
!
while( iter.hasNext() ) {
Property prop = (Property) iter.next();
--- 609,618 ----
setters = new ReflectHelper.Setter[hydrateSpan];
cascadeStyles = new Cascades.CascadeStyle[hydrateSpan];
!
iter = model.getPropertyClosureIterator();
i=0;
int tempVersionProperty=-66;
boolean foundCascade = false;
!
while( iter.hasNext() ) {
Property prop = (Property) iter.next();
***************
*** 625,629 ****
cascadeStyles[i] = prop.cascade();
if ( cascadeStyles[i]!=Cascades.STYLE_NONE ) foundCascade = true;
!
i++;
}
--- 625,629 ----
cascadeStyles[i] = prop.cascade();
if ( cascadeStyles[i]!=Cascades.STYLE_NONE ) foundCascade = true;
!
i++;
}
***************
*** 631,635 ****
hasCascades = foundCascade;
versionProperty = tempVersionProperty;
!
// CALLBACK INTERFACES
implementsLifecycle = Lifecycle.class.isAssignableFrom(mappedClass);
--- 631,635 ----
hasCascades = foundCascade;
versionProperty = tempVersionProperty;
!
// CALLBACK INTERFACES
implementsLifecycle = Lifecycle.class.isAssignableFrom(mappedClass);
***************
*** 661,665 ****
proxyInterfaces = (Class[]) pis.toArray(NO_CLASSES);
}
!
private boolean initHasCollections() {
return initHasCollections(propertyTypes);
--- 661,665 ----
proxyInterfaces = (Class[]) pis.toArray(NO_CLASSES);
}
!
private boolean initHasCollections() {
return initHasCollections(propertyTypes);
***************
*** 672,676 ****
}
else if ( types[i].isComponentType() ) {
! if ( initHasCollections(
( (AbstractComponentType) types[i] ).getSubtypes()
) ) return true;
--- 672,676 ----
}
else if ( types[i].isComponentType() ) {
! if ( initHasCollections(
( (AbstractComponentType) types[i] ).getSubtypes()
) ) return true;
***************
*** 679,687 ****
return false;
}
!
public ClassMetadata getClassMetadata() {
return this;
}
!
public Class getConcreteProxyClass() {
return concreteProxyClass;
--- 679,687 ----
return false;
}
!
public ClassMetadata getClassMetadata() {
return this;
}
!
public Class getConcreteProxyClass() {
return concreteProxyClass;
***************
*** 690,707 ****
//TODO: refactor! this is a duplicate of a method in the Loader heirarchy
protected static String aliasColumn(String name, String suffix) {
!
char quote = name.charAt(0);
! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
!
! if (nameEscaped) name = name.substring(1, name.length()-1);
!
! 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();
}
--- 690,707 ----
//TODO: refactor! this is a duplicate of a method in the Loader heirarchy
protected static String aliasColumn(String name, String suffix) {
!
char quote = name.charAt(0);
! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
!
! if (nameEscaped) name = name.substring(1, name.length()-1);
!
! 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();
}
***************
*** 709,716 ****
return superclass;
}
!
public boolean isExplicitPolymorphism() {
return explicitPolymorphism;
}
!
}
--- 709,719 ----
return superclass;
}
!
public boolean isExplicitPolymorphism() {
return explicitPolymorphism;
}
!
}
+
+
+
Index: ClassPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/ClassPersister.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ClassPersister.java 1 Jan 2003 13:56:33 -0000 1.1.1.1
--- ClassPersister.java 4 Jan 2003 11:15:30 -0000 1.2
***************
*** 18,33 ****
import net.sf.hibernate.metadata.ClassMetadata;
! /**
* Concrete <tt>ClassPersister</tt>s implement mapping and persistence logic for
* a particular persistent class.<br>
* <br>
* Implementors must be threadsafe (preferrably immutable) and must provide a constructor
! * of type
* <tt>(net.sf.hibernate.map.PersistentClass, net.sf.hibernate.impl.SessionFactoryImplementor)</tt>.
! *
* @see EntityPersister
*/
public interface ClassPersister extends Serializable {
!
/**
* Finish the initialization of this object, once all <tt>ClassPersisters</tt> have
--- 18,33 ----
import net.sf.hibernate.metadata.ClassMetadata;
! /**
* Concrete <tt>ClassPersister</tt>s implement mapping and persistence logic for
* a particular persistent class.<br>
* <br>
* Implementors must be threadsafe (preferrably immutable) and must provide a constructor
! * of type
* <tt>(net.sf.hibernate.map.PersistentClass, net.sf.hibernate.impl.SessionFactoryImplementor)</tt>.
! *
* @see EntityPersister
*/
public interface ClassPersister extends Serializable {
!
/**
* Finish the initialization of this object, once all <tt>ClassPersisters</tt> have
***************
*** 57,61 ****
*/
public String getClassName();
!
/**
* Does it have a composite key?
--- 57,61 ----
*/
public String getClassName();
!
/**
* Does it have a composite key?
***************
*** 95,99 ****
*/
public boolean hasCollections();
!
/**
* Does this class declare any cascading save/update/deletes?
--- 95,99 ----
*/
public boolean hasCollections();
!
/**
* Does this class declare any cascading save/update/deletes?
***************
*** 117,127 ****
*/
public boolean isUnsaved(Serializable id);
!
! /**
* Set the given values to the mapped properties of the given object
*/
public void setPropertyValues(Object object, Object[] values) throws HibernateException;
! /**
* Return the values of the mapped properties of the object
*/
--- 117,127 ----
*/
public boolean isUnsaved(Serializable id);
!
! /**
* Set the given values to the mapped properties of the given object
*/
public void setPropertyValues(Object object, Object[] values) throws HibernateException;
! /**
* Return the values of the mapped properties of the object
*/
***************
*** 132,141 ****
*/
public void setPropertyValue(Object object, int i, Object value) throws HibernateException;
!
/**
* Get the value of a particular property
*/
public Object getPropertyValue(Object object, int i) throws HibernateException;
!
/**
* Compare two snapshots of the state of an instance to determine if the persistent state was modified
--- 132,141 ----
*/
public void setPropertyValue(Object object, int i, Object value) throws HibernateException;
!
/**
* Get the value of a particular property
*/
public Object getPropertyValue(Object object, int i) throws HibernateException;
!
/**
* Compare two snapshots of the state of an instance to determine if the persistent state was modified
***************
*** 163,167 ****
*/
public Method getProxyGetIdentifierMethod();
!
/**
* Are instances of this class versioned by a timestamp or version number column?
--- 163,167 ----
*/
public Method getProxyGetIdentifierMethod();
!
/**
* Are instances of this class versioned by a timestamp or version number column?
***************
*** 188,192 ****
*/
public Object instantiate(Serializable id) throws HibernateException;
!
/**
* Return the <tt>IdentifierGenerator</tt> for the class
--- 188,192 ----
*/
public Object instantiate(Serializable id) throws HibernateException;
!
/**
* Return the <tt>IdentifierGenerator</tt> for the class
***************
*** 198,202 ****
*/
public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException;
!
/**
* Do a version check (optional operation)
--- 198,202 ----
*/
public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException;
!
/**
* Do a version check (optional operation)
***************
*** 204,213 ****
public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException;
! /**
* Persist an instance
*/
public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws SQLException, HibernateException;
! /**
* Persist an instance, using a natively generated identifier (optional operation)
*/
--- 204,213 ----
public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException;
! /**
* Persist an instance
*/
public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws SQLException, HibernateException;
! /**
* Persist an instance, using a natively generated identifier (optional operation)
*/
***************
*** 216,227 ****
/**
* Delete a persistent instance
! */
public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws SQLException, HibernateException;
/**
* Update a persistent instance
! */
! public void update(Serializable id, Object[] fields, int[] dirtyFields, Object oldVersion, Object object, SessionImplementor session) throws SQLException, HibernateException;
!
/**
* Get the Hibernate types of the class properties
--- 216,227 ----
/**
* Delete a persistent instance
! */
public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws SQLException, HibernateException;
/**
* Update a persistent instance
! */
! public void update(Serializable id, Object[] fields, int[] dirtyFields, Object oldVersion, Object object, SessionImplementor session) throws SQLException, HibernateException;
!
/**
* Get the Hibernate types of the class properties
***************
*** 230,234 ****
/**
! * Get the names of the class properties - doesn't have to be the names of the
* actual Java properties (used for XML generation only)
*/
--- 230,234 ----
/**
! * Get the names of the class properties - doesn't have to be the names of the
* actual Java properties (used for XML generation only)
*/
***************
*** 239,243 ****
*/
public Cascades.CascadeStyle[] getPropertyCascadeStyles();
!
/**
* Get the identifier type
--- 239,243 ----
*/
public Cascades.CascadeStyle[] getPropertyCascadeStyles();
!
/**
* Get the identifier type
***************
*** 246,251 ****
/**
! * Get the name of the identifier property (or return null) - need not return the
! * name of an actual Java property
*/
public String getIdentifierPropertyName();
--- 246,251 ----
/**
! * Get the name of the identifier property (or return null) - need not return the
! * name of an actual Java property
*/
public String getIdentifierPropertyName();
***************
*** 266,269 ****
--- 266,272 ----
}
+
+
+
Index: EntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** EntityPersister.java 1 Jan 2003 13:56:37 -0000 1.1.1.1
--- EntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2
***************
*** 44,69 ****
import net.sf.hibernate.engine.Versioning;
! /**
* The default implementation of the <tt>ClassPersister</tt> interface.
! * Implements the "table-per-class hierarchy" mapping strategy for an entity
* class.<br>
*/
public class EntityPersister extends AbstractEntityPersister implements Queryable {
!
private final SessionFactoryImplementor factory;
[...1022 lines suppressed...]
buf.append(", ")
! .append(name)
! .append('.')
! .append( cols[i] )
! .append(" as ")
! .append( aliasColumn(cols[i], suffix) );
}
return buf.toString();
}
!
public String getConcreteClassAlias(String alias) {
return alias;
}
!
}
+
+
+
Index: Loadable.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/Loadable.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Loadable.java 1 Jan 2003 13:56:37 -0000 1.1.1.1
--- Loadable.java 4 Jan 2003 11:15:30 -0000 1.2
***************
*** 8,12 ****
* 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 net.sf.hibernate.loader.Loader
* @see net.sf.hibernate.loader.OuterJoinLoader
--- 8,12 ----
* 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 net.sf.hibernate.loader.Loader
* @see net.sf.hibernate.loader.OuterJoinLoader
***************
*** 23,27 ****
*/
public boolean hasSubclasses();
!
/**
* Get the name of the column used as a discriminator
--- 23,27 ----
*/
public boolean hasSubclasses();
!
/**
* Get the name of the column used as a discriminator
***************
*** 36,40 ****
/**
* Get the concrete subclass corresponding to the given discriminator
! * value
*/
public Class getSubclassForDiscriminatorValue(Object value);
--- 36,40 ----
/**
* Get the concrete subclass corresponding to the given discriminator
! * value
*/
public Class getSubclassForDiscriminatorValue(Object value);
***************
*** 44,48 ****
*/
public String[] getPropertyColumnNames(int i);
!
//USED BY OuterJoinLoader + subclasses
--- 44,48 ----
*/
public String[] getPropertyColumnNames(int i);
!
//USED BY OuterJoinLoader + subclasses
***************
*** 51,55 ****
*/
public String getTableName();
!
/**
* How many properties are there, for this class and all subclasses?
--- 51,55 ----
*/
public String getTableName();
!
/**
* How many properties are there, for this class and all subclasses?
***************
*** 87,91 ****
*/
public String[] toColumns(String name, int i);
!
/**
* Given a query alias and an identifying suffix, render the
--- 87,91 ----
*/
public String[] toColumns(String name, int i);
!
/**
* Given a query alias and an identifying suffix, render the
***************
*** 116,117 ****
--- 116,120 ----
}
+
+
+
Index: MultiTableEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/MultiTableEntityPersister.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** MultiTableEntityPersister.java 1 Jan 2003 13:56:40 -0000 1.1.1.1
--- MultiTableEntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2
***************
*** 46,55 ****
import net.sf.hibernate.engine.Versioning;
! /**
* A <tt>ClassPersister</tt> implementing the normalized "table-per-subclass"
* mapping strategy.<br>
*/
public class MultiTableEntityPersister extends AbstractEntityPersister {
!
private final SessionFactoryImplementor factory;
[...1216 lines suppressed...]
if (tab!=0) buf.append('_').append(tab);
buf.append('.')
! .append( cols[i] )
! .append(" as ")
! .append( aliasColumn( subclassColumnClosureAliases[i], suffix) );
}
return buf.toString();
}
!
public String getConcreteClassAlias(String alias) {
int tab = tableNumbers[ tableNumbers.length-1 ];
return alias + ( (tab==0) ? "" : '_' +Integer.toString(tab) );
}
!
}
+
+
+
Index: Queryable.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/Queryable.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Queryable.java 1 Jan 2003 13:56:40 -0000 1.1.1.1
--- Queryable.java 4 Jan 2003 11:15:30 -0000 1.2
***************
*** 30,34 ****
*/
public String getDiscriminatorSQLString();
!
/**
* Given a component path expression, get the type of the property
--- 30,34 ----
*/
public String getDiscriminatorSQLString();
!
/**
* Given a component path expression, get the type of the property
***************
*** 57,58 ****
--- 57,61 ----
public String[] toColumns(String name, String property) throws QueryException;
}
+
+
+
|