Skip to content

Commit

Permalink
HHH-7712 remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
stliu committed Oct 24, 2012
1 parent 5501336 commit 9fbfcdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 84 deletions.
Expand Up @@ -319,10 +319,6 @@ protected Set getSubclassEntityNames() {
return entityMetamodel.getSubclassEntityNames();
}

public Serializable getIdentifier(Object entity) throws HibernateException {
return getIdentifier( entity, null );
}

public Serializable getIdentifier(Object entity, SessionImplementor session) {
final Object id;
if ( entityMetamodel.getIdentifierProperty().isEmbedded() ) {
Expand Down Expand Up @@ -357,16 +353,6 @@ public Serializable getIdentifier(Object entity, SessionImplementor session) {
}
}

/**
* {@inheritDoc}
*/
public void setIdentifier(Object entity, Serializable id) throws HibernateException {
// 99% of the time the session is not needed. Its only needed for certain brain-dead
// interpretations of JPA 2 "derived identity" support
setIdentifier( entity, id, null );
}


/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -417,8 +403,8 @@ private static MappedIdentifierValueMarshaller buildMappedIdentifierValueMarshal
}

return wereAllEquivalent
? (MappedIdentifierValueMarshaller) new NormalMappedIdentifierValueMarshaller( virtualIdComponent, mappedIdClassComponentType )
: (MappedIdentifierValueMarshaller) new IncrediblySillyJpaMapsIdMappedIdentifierValueMarshaller( virtualIdComponent, mappedIdClassComponentType );
? new NormalMappedIdentifierValueMarshaller( virtualIdComponent, mappedIdClassComponentType )
: new IncrediblySillyJpaMapsIdMappedIdentifierValueMarshaller( virtualIdComponent, mappedIdClassComponentType );
}

private static class NormalMappedIdentifierValueMarshaller implements MappedIdentifierValueMarshaller {
Expand Down Expand Up @@ -548,16 +534,6 @@ private static Iterable<PersistEventListener> persistEventListeners(SessionImple
.getEventListenerGroup( EventType.PERSIST )
.listeners();
}

/**
* {@inheritDoc}
*/
public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion) {
// 99% of the time the session is not needed. Its only needed for certain brain-dead
// interpretations of JPA 2 "derived identity" support
resetIdentifier( entity, currentId, currentVersion, null );
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -726,12 +702,6 @@ public void setPropertyValue(Object entity, String propertyName, Object value) t
setters[ entityMetamodel.getPropertyIndex( propertyName ) ].set( entity, value, getFactory() );
}

public final Object instantiate(Serializable id) throws HibernateException {
// 99% of the time the session is not needed. Its only needed for certain brain-dead
// interpretations of JPA 2 "derived identity" support
return instantiate( id, null );
}

public final Object instantiate(Serializable id, SessionImplementor session) {
Object result = getInstantiator().instantiate( id );
if ( id != null ) {
Expand Down
Expand Up @@ -53,18 +53,6 @@ public interface EntityTuplizer extends Tuplizer {
*/
public EntityMode getEntityMode();

/**
* Create an entity instance initialized with the given identifier.
*
* @param id The identifier value for the entity to be instantiated.
* @return The instantiated entity.
* @throws HibernateException
*
* @deprecated Use {@link #instantiate(Serializable, SessionImplementor)} instead.
*/
@SuppressWarnings( {"JavaDoc"})
public Object instantiate(Serializable id) throws HibernateException;

/**
* Create an entity instance initialized with the given identifier.
*
Expand All @@ -75,20 +63,6 @@ public interface EntityTuplizer extends Tuplizer {
*/
public Object instantiate(Serializable id, SessionImplementor session);

/**
* Extract the identifier value from the given entity.
*
* @param entity The entity from which to extract the identifier value.
*
* @return The identifier value.
*
* @throws HibernateException If the entity does not define an identifier property, or an
* error occurs accessing its value.
*
* @deprecated Use {@link #getIdentifier(Object,SessionImplementor)} instead.
*/
public Serializable getIdentifier(Object entity) throws HibernateException;

/**
* Extract the identifier value from the given entity.
*
Expand All @@ -99,19 +73,6 @@ public interface EntityTuplizer extends Tuplizer {
*/
public Serializable getIdentifier(Object entity, SessionImplementor session);

/**
* Inject the identifier value into the given entity.
* </p>
* Has no effect if the entity does not define an identifier property
*
* @param entity The entity to inject with the identifier value.
* @param id The value to be injected as the identifier.
*
* @deprecated Use {@link #setIdentifier(Object, Serializable, SessionImplementor)} instead.
*/
@SuppressWarnings( {"JavaDoc"})
public void setIdentifier(Object entity, Serializable id) throws HibernateException;

/**
* Inject the identifier value into the given entity.
* </p>
Expand All @@ -123,19 +84,6 @@ public interface EntityTuplizer extends Tuplizer {
*/
public void setIdentifier(Object entity, Serializable id, SessionImplementor session);

/**
* Inject the given identifier and version into the entity, in order to
* "roll back" to their original values.
*
* @param entity The entity for which to reset the id/version values
* @param currentId The identifier value to inject into the entity.
* @param currentVersion The version value to inject into the entity.
*
* @deprecated Use {@link #resetIdentifier(Object, Serializable, Object, SessionImplementor)} instead
*/
@SuppressWarnings( {"UnusedDeclaration"})
public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion);

/**
* Inject the given identifier and version into the entity, in order to
* "roll back" to their original values.
Expand Down

0 comments on commit 9fbfcdc

Please sign in to comment.