congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PojoEntityTuplizer.getEntityMetamodel
Code IndexAdd Tabnine to your IDE (free)

How to use
getEntityMetamodel
method
in
org.hibernate.tuple.entity.PojoEntityTuplizer

Best Java code snippets using org.hibernate.tuple.entity.PojoEntityTuplizer.getEntityMetamodel (Showing top 11 results out of 315)

origin: hibernate/hibernate-orm

@Override
public void setPropertyValues(Object entity, Object[] values) throws HibernateException {
  if ( !getEntityMetamodel().hasLazyProperties() && optimizer != null && optimizer.getAccessOptimizer() != null ) {
    setPropertyValuesWithOptimizer( entity, values );
  }
  else {
    super.setPropertyValues( entity, values );
  }
}
origin: hibernate/hibernate-orm

@Override
public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {
  if ( entityInstance == null ) {
    return getEntityName();
  }
  final Class concreteEntityClass = entityInstance.getClass();
  if ( concreteEntityClass == getMappedClass() ) {
    return getEntityName();
  }
  else {
    String entityName = getEntityMetamodel().findEntityNameByEntityClass( concreteEntityClass );
    if ( entityName == null ) {
      throw new HibernateException(
          "Unable to resolve entity name from Class [" + concreteEntityClass.getName() + "]"
              + " expected instance/subclass of [" + getEntityName() + "]"
      );
    }
    return entityName;
  }
}
origin: hibernate/hibernate-orm

@Override
public void afterInitialize(Object entity, SharedSessionContractImplementor session) {
  // moving to multiple fetch groups, the idea of `lazyPropertiesAreUnfetched` really
  // needs to become either:
  // 		1) the names of all un-fetched fetch groups
  //		2) the names of all fetched fetch groups
  // probably (2) is best
  //
  // ultimately this comes from EntityEntry, although usage-search seems to show it is never updated there.
  //
  // also org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromDatastore()
  //		needs to be re-worked
  if ( entity instanceof PersistentAttributeInterceptable ) {
    final LazyAttributeLoadingInterceptor interceptor = getEntityMetamodel().getBytecodeEnhancementMetadata().extractInterceptor( entity );
    if ( interceptor == null ) {
      getEntityMetamodel().getBytecodeEnhancementMetadata().injectInterceptor( entity, session );
    }
    else {
      if ( interceptor.getLinkedSession() == null ) {
        interceptor.setSession( session );
      }
    }
  }
  // clear the fields that are marked as dirty in the dirtyness tracker
  if ( entity instanceof SelfDirtinessTracker ) {
    ( (SelfDirtinessTracker) entity ).$$_hibernate_clearDirtyAttributes();
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
@Override
public boolean hasUninitializedLazyProperties(Object entity) {
  if ( getEntityMetamodel().hasLazyProperties() ) {
    FieldInterceptor callback = FieldInterceptionHelper.extractFieldInterceptor( entity );
    return callback != null && !callback.isInitialized();
  }
  else {
    return false;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
@Override
public boolean hasUninitializedLazyProperties(Object entity) {
  if ( getEntityMetamodel().hasLazyProperties() ) {
    FieldInterceptor callback = FieldInterceptionHelper.extractFieldInterceptor( entity );
    return callback != null && !callback.isInitialized();
  }
  else {
    return false;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {
  final Class concreteEntityClass = entityInstance.getClass();
  if ( concreteEntityClass == getMappedClass() ) {
    return getEntityName();
  }
  else {
    String entityName = getEntityMetamodel().findEntityNameByEntityClass( concreteEntityClass );
    if ( entityName == null ) {
      throw new HibernateException(
          "Unable to resolve entity name from Class [" + concreteEntityClass.getName() + "]"
              + " expected instance/subclass of [" + getEntityName() + "]"
      );
    }
    return entityName;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
@Override
public void setPropertyValues(Object entity, Object[] values) throws HibernateException {
  if ( !getEntityMetamodel().hasLazyProperties() && optimizer != null && optimizer.getAccessOptimizer() != null ) {
    setPropertyValuesWithOptimizer( entity, values );
  }
  else {
    super.setPropertyValues( entity, values );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {
  final Class concreteEntityClass = entityInstance.getClass();
  if ( concreteEntityClass == getMappedClass() ) {
    return getEntityName();
  }
  else {
    String entityName = getEntityMetamodel().findEntityNameByEntityClass( concreteEntityClass );
    if ( entityName == null ) {
      throw new HibernateException(
          "Unable to resolve entity name from Class [" + concreteEntityClass.getName() + "]"
              + " expected instance/subclass of [" + getEntityName() + "]"
      );
    }
    return entityName;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
@Override
public void setPropertyValues(Object entity, Object[] values) throws HibernateException {
  if ( !getEntityMetamodel().hasLazyProperties() && optimizer != null && optimizer.getAccessOptimizer() != null ) {
    setPropertyValuesWithOptimizer( entity, values );
  }
  else {
    super.setPropertyValues( entity, values );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
@Override
public void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session) {
  if ( isInstrumented() ) {
    Set lazyProps = lazyPropertiesAreUnfetched && getEntityMetamodel().hasLazyProperties() ?
        lazyPropertyNames : null;
    //TODO: if we support multiple fetch groups, we would need
    //      to clone the set of lazy properties!
    FieldInterceptionHelper.injectFieldInterceptor( entity, getEntityName(), lazyProps, session );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
@Override
public void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session) {
  if ( isInstrumented() ) {
    Set lazyProps = lazyPropertiesAreUnfetched && getEntityMetamodel().hasLazyProperties() ?
        lazyPropertyNames : null;
    //TODO: if we support multiple fetch groups, we would need
    //      to clone the set of lazy properties!
    FieldInterceptionHelper.injectFieldInterceptor( entity, getEntityName(), lazyProps, session );
  }
}
org.hibernate.tuple.entityPojoEntityTuplizergetEntityMetamodel

Popular methods of PojoEntityTuplizer

  • buildProxyFactory
  • buildProxyFactoryInternal
  • getEntityName
  • getMappedClass
  • getPropertyValuesWithOptimizer
  • setPropertyValuesWithOptimizer
  • shouldGetAllProperties
  • getGetter
  • getPropertyAccessor
  • getSetter
  • isInstrumented
  • getFactory
  • isInstrumented,
  • getFactory,
  • getPropertyValues

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JTable (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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