Codota Logo
SessionImplementor.getEntityPersister
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using org.hibernate.engine.spi.SessionImplementor.getEntityPersister (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 EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException {
  return delegate.getEntityPersister( entityName, object );
}
origin: stackoverflow.com

 public class UseExistingOrGenerateIdGenerator extends SequenceGenerator {
  @Override
  public Serializable generate(SessionImplementor session, Object object)
            throws HibernateException {
    Serializable id = session.getEntityPersister(null, object)
           .getClassMetadata().getIdentifier(object, session);
    return id != null ? id : super.generate(session, object);
  }
}
origin: hibernate/hibernate-orm

public static Object getIdentifier(SessionImplementor session, String entityName, Object obj) {
  if ( obj == null ) {
    return null;
  }
  if ( obj instanceof HibernateProxy ) {
    final HibernateProxy hibernateProxy = (HibernateProxy) obj;
    return hibernateProxy.getHibernateLazyInitializer().getIdentifier();
  }
  return session.getEntityPersister( entityName, obj ).getIdentifier( obj, session );
}
origin: hibernate/hibernate-orm

final EntityPersister persister = source.getEntityPersister( event.getEntityName(), entity );
final Serializable id = persister.getIdentifier( entity, source );
if ( !ForeignKeys.isNotTransient( event.getEntityName(), entity, Boolean.FALSE, source ) ) {
origin: openmrs/openmrs-core

@Override
public Serializable generate(SessionImplementor session, Object entity) throws HibernateException {
  Serializable id;
  EntityPersister persister = session.getEntityPersister(entityName, entity);
  // Determine if an ID has been assigned.
  id = persister.getIdentifier(entity, session);
  if (id == null) {
    id = super.generate(session, entity);
  }
  return id;
}

origin: riotfamily/riot

public EntityPersister getEntityPersister(String entityName,
    Object object) throws HibernateException {
  return session.getEntityPersister(entityName, object);
}
origin: org.jboss.seam/jboss-seam

public EntityPersister getEntityPersister(String paramString, Object paramObject) throws HibernateException
{
 return ((SessionImplementor) delegate).getEntityPersister(paramString, paramObject);
}
origin: stackoverflow.com

 public class UseExistingOrGenerateIdGenerator extends SequenceHiLoGenerator {
  @Override
  public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
    Serializable id = session.getEntityPersister(null, object).getClassMetadata().getIdentifier(object, session);
    return id != null ? id : super.generate(session, object);
  }

  @Override
  public void configure(Type type, Properties params, Dialect dialect) throws MappingException {

    params.put(org.hibernate.id.SequenceGenerator.SEQUENCE, "HIBERNATE_SEQUENCE");

    params.put(SequenceHiLoGenerator.MAX_LO, String.valueOf("49"));
    super.configure(type, params, dialect);
  }

}
origin: com.atlassian.hibernate/hibernate.adapter

@Override
public EntityPersister getEntityPersister(final String entityName, final Object object) throws HibernateException {
  return getSessionImplementor().getEntityPersister(entityName, object);
}
origin: org.hibernate/com.springsource.org.hibernate

  public Serializable locateGenerationContext(SessionImplementor session, Object incomingObject) {
    return session.getEntityPersister( entityName, incomingObject ).getIdentifier( incomingObject, session );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

  public Serializable locateGenerationContext(SessionImplementor session, Object incomingObject) {
    return session.getEntityPersister( entityName, incomingObject ).getIdentifier( incomingObject, session );
  }
}
origin: com.intoverflow.booster/booster-core

public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
  final Serializable id = session.getEntityPersister(entityName, object).getIdentifier(object, session);
  if (id == null) {
    return super.generate(session, object);
  }
  return id;
}
origin: org.hibernate/com.springsource.org.hibernate.core

public Serializable generate(SessionImplementor session, Object obj) throws HibernateException {
  //TODO: cache the persister, this shows up in yourkit
  final Serializable id = session.getEntityPersister( entityName, obj ).getIdentifier( obj, session );
  if ( id == null ) {
    throw new IdentifierGenerationException(
        "ids for this class must be manually assigned before calling save(): " + entityName
    );
  }
  
  return id;
}
origin: com.intoverflow.booster/booster-core

public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
  final Serializable id = session.getEntityPersister(entityName, object).getIdentifier(object, session);
  if (id == null) {
    return super.generate(session, object);
  }
  return id;
}
origin: org.hibernate/com.springsource.org.hibernate

public Serializable generate(SessionImplementor session, Object obj) throws HibernateException {
  //TODO: cache the persister, this shows up in yourkit
  final Serializable id = session.getEntityPersister( entityName, obj ).getIdentifier( obj, session );
  if ( id == null ) {
    throw new IdentifierGenerationException(
        "ids for this class must be manually assigned before calling save(): " + entityName
    );
  }
  
  return id;
}
origin: com.atlassian.hibernate/hibernate.adapter

@Override
public ClassPersister getPersister(final Object object) throws MappingException {
  final String entityName = net.sf.hibernate.Hibernate.getClass(object).getName();
  return ClassPersisterV2Adapter.adapt(
      sessionImplementor.getEntityPersister(entityName, object),
      session.getSessionFactory(),
      session);
}
origin: com.intoverflow.booster/booster-core

public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
  final Serializable id = session.getEntityPersister(entityName, object).getIdentifier(object, session);
  if (id == null) {
    return super.generate(session, object);
  }
  return id;
}
origin: org.hibernate/com.springsource.org.hibernate.core

private static EntityKey getOptionalObjectKey(QueryParameters queryParameters, SessionImplementor session) {
  final Object optionalObject = queryParameters.getOptionalObject();
  final Serializable optionalId = queryParameters.getOptionalId();
  final String optionalEntityName = queryParameters.getOptionalEntityName();
  if ( optionalObject != null && optionalEntityName != null ) {
    return session.generateEntityKey( optionalId, session.getEntityPersister( optionalEntityName, optionalObject ) );
  }
  else {
    return null;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

private static EntityKey getOptionalObjectKey(QueryParameters queryParameters, SessionImplementor session) {
  final Object optionalObject = queryParameters.getOptionalObject();
  final Serializable optionalId = queryParameters.getOptionalId();
  final String optionalEntityName = queryParameters.getOptionalEntityName();
  if ( optionalObject != null && optionalEntityName != null ) {
    return session.generateEntityKey( optionalId, session.getEntityPersister( optionalEntityName, optionalObject ) );
  }
  else {
    return null;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

public Object nullSafeGet(
    ResultSet rs,
    String name,
    SessionImplementor session,
    Object owner) throws HibernateException, SQLException {
  final Object discriminatorValue = underlyingType.nullSafeGet( rs, name, session, owner );
  final String entityName = persister.getSubclassForDiscriminatorValue( discriminatorValue );
  if ( entityName == null ) {
    throw new HibernateException( "Unable to resolve discriminator value [" + discriminatorValue + "] to entity name" );
  }
  final EntityPersister entityPersister = session.getEntityPersister( entityName, null );
  return ( EntityMode.POJO == entityPersister.getEntityMode() ) ? entityPersister.getMappedClass() : entityName;
}
org.hibernate.engine.spiSessionImplementorgetEntityPersister

Javadoc

Get the EntityPersister for any instance

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?
  • 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
  • getContextEntityIdentifier
  • generateEntityKey,
  • getContextEntityIdentifier,
  • isOpen,
  • bestGuessEntityName,
  • getFlushMode,
  • getSessionFactory,
  • guessEntityName,
  • immediateLoad,
  • initializeCollection

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • addToBackStack (FragmentTransaction)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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