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

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

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

origin: hibernate/hibernate-orm

  @Override
  protected ProxyFactory buildProxyFactory(
      PersistentClass persistentClass,
      Getter idGetter,
      Setter idSetter) {
    return super.buildProxyFactory(
      persistentClass, idGetter,
      idSetter
    );
  }
}
origin: hibernate/hibernate-orm

  if ( !proxyInterface.isInterface() ) {
    throw new MappingException(
        "proxy must be either an interface, or the class itself: " + getEntityName()
    );
    ReflectHelper.getMethod( proxyInterface, idSetterMethod );
ProxyFactory pf = buildProxyFactoryInternal( persistentClass, idGetter, idSetter );
try {
  pf.postInstantiate(
      getEntityName(),
      mappedClass,
      proxyInterfaces,
  LOG.unableToCreateProxyFactory( getEntityName(), he );
  pf = null;
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 Object[] getPropertyValues(Object entity) throws HibernateException {
  if ( shouldGetAllProperties( entity ) && optimizer != null && optimizer.getAccessOptimizer() != null ) {
    return getPropertyValuesWithOptimizer( entity );
  }
  else {
    return super.getPropertyValues( entity );
  }
}
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: org.hibernate/com.springsource.org.hibernate

  if ( ! proxyInterface.isInterface() ) {
    throw new MappingException(
        "proxy must be either an interface, or the class itself: " + getEntityName()
    );
  Method method = getGetter( property ).getMethod();
  if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
    LOG.gettersOfLazyClassesCannotBeFinal(entityBinding.getEntity().getName(), property.getAttribute().getName());
  method = getSetter( property ).getMethod();
  if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
    LOG.settersOfLazyClassesCannotBeFinal(entityBinding.getEntity().getName(), property.getAttribute().getName());
    ReflectHelper.getMethod(proxyInterface, idSetterMethod);
ProxyFactory pf = buildProxyFactoryInternal( entityBinding, idGetter, idSetter );
try {
  pf.postInstantiate(
      getEntityName(),
      mappedClass,
      proxyInterfaces,
  LOG.unableToCreateProxyFactory(getEntityName(), he);
  pf = null;
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: 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

private Getter getGetter(AttributeBinding mappedProperty)  throws PropertyNotFoundException, MappingException {
  return getPropertyAccessor( mappedProperty ).getGetter(
      mappedProperty.getContainer().getClassReference(),
      mappedProperty.getAttribute().getName()
  );
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
@Override
protected Getter buildPropertyGetter(AttributeBinding mappedProperty) {
  return getGetter( mappedProperty );
}
origin: hibernate/hibernate-orm

@Override
public Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionContractImplementor session) {
  if ( shouldGetAllProperties( entity ) && optimizer != null && optimizer.getAccessOptimizer() != null ) {
    return getPropertyValuesWithOptimizer( entity );
  }
  else {
    return super.getPropertyValuesToInsert( entity, mergeMap, session );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

  if ( ! proxyInterface.isInterface() ) {
    throw new MappingException(
        "proxy must be either an interface, or the class itself: " + getEntityName()
    );
  Method method = getGetter( property ).getMethod();
  if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
    LOG.gettersOfLazyClassesCannotBeFinal(entityBinding.getEntity().getName(), property.getAttribute().getName());
  method = getSetter( property ).getMethod();
  if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
    LOG.settersOfLazyClassesCannotBeFinal(entityBinding.getEntity().getName(), property.getAttribute().getName());
    ReflectHelper.getMethod(proxyInterface, idSetterMethod);
ProxyFactory pf = buildProxyFactoryInternal( entityBinding, idGetter, idSetter );
try {
  pf.postInstantiate(
      getEntityName(),
      mappedClass,
      proxyInterfaces,
  LOG.unableToCreateProxyFactory(getEntityName(), he);
  pf = null;
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 );
  }
}
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}
 */
@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

private Getter getGetter(AttributeBinding mappedProperty)  throws PropertyNotFoundException, MappingException {
  return getPropertyAccessor( mappedProperty ).getGetter(
      mappedProperty.getContainer().getClassReference(),
      mappedProperty.getAttribute().getName()
  );
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
@Override
protected Getter buildPropertyGetter(AttributeBinding mappedProperty) {
  return getGetter( mappedProperty );
}
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

/**
 * {@inheritDoc}
 */
@Override
public Object[] getPropertyValues(Object entity) throws HibernateException {
  if ( shouldGetAllProperties( entity ) && optimizer != null && optimizer.getAccessOptimizer() != null ) {
    return getPropertyValuesWithOptimizer( entity );
  }
  else {
    return super.getPropertyValues( entity );
  }
}
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 );
  }
}
org.hibernate.tuple.entityPojoEntityTuplizer

Javadoc

An EntityTuplizer specific to the pojo entity mode.

Most used methods

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JFrame (javax.swing)
  • 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