congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SessionImplementor.getContextEntityIdentifier
Code IndexAdd Tabnine to your IDE (free)

How to use
getContextEntityIdentifier
method
in
org.hibernate.engine.spi.SessionImplementor

Best Java code snippets using org.hibernate.engine.spi.SessionImplementor.getContextEntityIdentifier (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

@Override
public Serializable getContextEntityIdentifier(Object object) {
  return delegate.getContextEntityIdentifier( object );
}
origin: hibernate/hibernate-orm

( (SessionImplementor) session ).getContextEntityIdentifier( a2.getB() ),
( (SessionImplementor) session ).getFactory().getEntityPersister( B.class.getName() )
origin: org.hibernate/com.springsource.org.hibernate

public Object hydrate(
  ResultSet rs,
  String[] names,
  SessionImplementor session,
  Object owner)
throws HibernateException, SQLException {
  return session.getContextEntityIdentifier(owner);
}
origin: org.jboss.seam/jboss-seam

public Serializable getContextEntityIdentifier(Object paramObject)
{
 return ((SessionImplementor) delegate).getContextEntityIdentifier(paramObject);
}
origin: org.hibernate/com.springsource.org.hibernate.core

public Object hydrate(
  ResultSet rs,
  String[] names,
  SessionImplementor session,
  Object owner)
throws HibernateException, SQLException {
  return session.getContextEntityIdentifier(owner);
}
origin: org.hibernate.orm/hibernate-core

@Override
public Object getContextEntityIdentifier(Object object) {
  return delegate.getContextEntityIdentifier( object );
}
origin: riotfamily/riot

public Serializable getContextEntityIdentifier(Object object) {
  return session.getContextEntityIdentifier(object);
}
origin: org.hibernate/com.springsource.org.hibernate

public Object assemble(Serializable oid, SessionImplementor session, Object owner)
throws HibernateException {
  //this should be a call to resolve(), not resolveIdentifier(), 
  //'cos it might be a property-ref, and we did not cache the
  //referenced value
  return resolve( session.getContextEntityIdentifier(owner), session, owner );
}

origin: org.hibernate/com.springsource.org.hibernate.core

public Object assemble(Serializable oid, SessionImplementor session, Object owner)
throws HibernateException {
  //this should be a call to resolve(), not resolveIdentifier(), 
  //'cos it might be a property-ref, and we did not cache the
  //referenced value
  return resolve( session.getContextEntityIdentifier(owner), session, owner );
}

origin: com.atlassian.hibernate/hibernate.adapter

@Override
public Serializable getContextEntityIdentifier(final Object object) {
  return getSessionImplementor().getContextEntityIdentifier(object);
}
origin: org.hibernate/com.springsource.org.hibernate.core

private Object getObjectFromList(List results, Serializable id, SessionImplementor session) {
  // get the right object from the list ... would it be easier to just call getEntity() ??
  Iterator iter = results.iterator();
  while ( iter.hasNext() ) {
    Object obj = iter.next();
    final boolean equal = idType.isEqual(
        id,
        session.getContextEntityIdentifier(obj),
        session.getFactory()
    );
    if ( equal ) return obj;
  }
  return null;
}
origin: org.hibernate/com.springsource.org.hibernate

private Object getObjectFromList(List results, Serializable id, SessionImplementor session) {
  // get the right object from the list ... would it be easier to just call getEntity() ??
  Iterator iter = results.iterator();
  while ( iter.hasNext() ) {
    Object obj = iter.next();
    final boolean equal = idType.isEqual(
        id,
        session.getContextEntityIdentifier(obj),
        session.getFactory()
    );
    if ( equal ) return obj;
  }
  return null;
}
origin: stackoverflow.com

public Object initializeLazyProperty(String fieldName, Object entity,
            SessionImplementor session) throws HibernateException {
 final Serializable id = session.getContextEntityIdentifier( entity );
 final EntityEntry entry = session.getPersistenceContext().getEntry( entity );
 if ( entry == null ) {
  throw new
    HibernateException("entity is not associated with the session: " + id);
 }
 ...
origin: org.hibernate/com.springsource.org.hibernate

public boolean isNull(Object owner, SessionImplementor session) {
  if ( propertyName != null ) {
    final EntityPersister ownerPersister = session.getFactory().getEntityPersister( entityName );
    final Serializable id = session.getContextEntityIdentifier( owner );
    final EntityKey entityKey = session.generateEntityKey( id, ownerPersister );
    return session.getPersistenceContext().isPropertyNull( entityKey, getPropertyName() );
  }
  else {
    return false;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

public boolean isNull(Object owner, SessionImplementor session) {
  if ( propertyName != null ) {
    final EntityPersister ownerPersister = session.getFactory().getEntityPersister( entityName );
    final Serializable id = session.getContextEntityIdentifier( owner );
    final EntityKey entityKey = session.generateEntityKey( id, ownerPersister );
    return session.getPersistenceContext().isPropertyNull( entityKey, getPropertyName() );
  }
  else {
    return false;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

Serializable id = session.getContextEntityIdentifier( object );
if ( id == null ) {
origin: org.hibernate/com.springsource.org.hibernate

Serializable id = session.getContextEntityIdentifier( object );
if ( id == null ) {
origin: org.hibernate/com.springsource.org.hibernate.core

  return target;
if ( session.getContextEntityIdentifier( original ) == null  &&
    ForeignKeys.isTransient( associatedEntityName, original, Boolean.FALSE, session ) ) {
  final Object copy = session.getFactory().getEntityPersister( associatedEntityName )
origin: org.hibernate/com.springsource.org.hibernate

public Object initializeLazyProperty(String fieldName, Object entity, SessionImplementor session)
    throws HibernateException {
  final Serializable id = session.getContextEntityIdentifier( entity );
  final EntityEntry entry = session.getPersistenceContext().getEntry( entity );
  if ( entry == null ) {
    throw new HibernateException( "entity is not associated with the session: " + id );
  }
  if ( LOG.isTraceEnabled() ) {
    LOG.tracev( "Initializing lazy properties of: {0}, field access: {1}", MessageHelper.infoString( this, id, getFactory() ), fieldName );
  }
  if ( hasCache() ) {
    CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
    Object ce = getCacheAccessStrategy().get( cacheKey, session.getTimestamp() );
    if (ce!=null) {
      CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure(ce, factory);
      if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
        //note early exit here:
        return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
      }
    }
  }
  return initializeLazyPropertiesFromDatastore( fieldName, entity, session, id, entry );
}
origin: org.hibernate/com.springsource.org.hibernate.core

public Object initializeLazyProperty(String fieldName, Object entity, SessionImplementor session)
    throws HibernateException {
  final Serializable id = session.getContextEntityIdentifier( entity );
  final EntityEntry entry = session.getPersistenceContext().getEntry( entity );
  if ( entry == null ) {
    throw new HibernateException( "entity is not associated with the session: " + id );
  }
  if ( LOG.isTraceEnabled() ) {
    LOG.tracev( "Initializing lazy properties of: {0}, field access: {1}", MessageHelper.infoString( this, id, getFactory() ), fieldName );
  }
  if ( hasCache() ) {
    CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
    Object ce = getCacheAccessStrategy().get( cacheKey, session.getTimestamp() );
    if (ce!=null) {
      CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure(ce, factory);
      if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
        //note early exit here:
        return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
      }
    }
  }
  return initializeLazyPropertiesFromDatastore( fieldName, entity, session, id, entry );
}
org.hibernate.engine.spiSessionImplementorgetContextEntityIdentifier

Javadoc

Return the identifier of the persistent object, or null if not associated with the session

Popular methods of SessionImplementor

  • getFactory
    Get the creating SessionFactoryImplementor
  • getTransactionCoordinator
  • connection
  • getPersistenceContext
    Get the persistence context for this session
  • getLoadQueryInfluencers
    Get the load query influencers associated with this session.
  • isTransactionInProgress
    Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?
  • getEntityPersister
    Get the EntityPersister for any instance
  • getJdbcCoordinator
  • isClosed
    Determine whether the session is closed. Provided separately from #isOpen() as this method does not
  • flush
  • getTenantIdentifier
    Match te method on org.hibernate.Session and org.hibernate.StatelessSession
  • generateEntityKey
  • getTenantIdentifier,
  • generateEntityKey,
  • isOpen,
  • bestGuessEntityName,
  • getFlushMode,
  • getSessionFactory,
  • guessEntityName,
  • immediateLoad,
  • initializeCollection

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now