Codota Logo
SessionImplementor.getContextEntityIdentifier
Code IndexAdd Codota 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)

  • Common ways to obtain SessionImplementor
private void myMethod () {
SessionImplementor s =
  • Codota IconEntityManager entityManager;entityManager.unwrap(SessionImplementor.class)
  • Codota IconFlushEntityEvent flushEntityEvent;flushEntityEvent.getSession()
  • Codota IconLazyInitializer lazyInitializer;lazyInitializer.getSession()
  • Smart code suggestions by Codota
}
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

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • onCreateOptionsMenu (Activity)
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now