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

How to use
getPropertyValues
method
in
org.hibernate.metadata.ClassMetadata

Best Java code snippets using org.hibernate.metadata.ClassMetadata.getPropertyValues (Showing top 8 results out of 315)

origin: hibernate/hibernate-orm

private boolean copyState(Object entity, Type[] types, Object[] state, SessionFactory sf) {
  // copy the entity state into the state array and return true if the state has changed
  ClassMetadata metadata = sf.getClassMetadata( entity.getClass() );
  Object[] newState = metadata.getPropertyValues( entity );
  int size = newState.length;
  boolean isDirty = false;
  for ( int index = 0; index < size; index++ ) {
    if ( ( state[index] == LazyPropertyInitializer.UNFETCHED_PROPERTY &&
        newState[index] != LazyPropertyInitializer.UNFETCHED_PROPERTY ) ||
        ( state[index] != newState[index] && !types[index].isEqual( state[index], newState[index] ) ) ) {
      isDirty = true;
      state[index] = newState[index];
    }
  }
  return isDirty;
}
origin: com.atlassian.hibernate/hibernate.adapter

@Override
public Object[] getPropertyValues(final Object entity) throws HibernateException {
  return PropertyValueAdapter.adaptToV2(metadata.getPropertyValues(entity));
}
origin: org.hibernate/com.springsource.org.hibernate.ejb

  private boolean copyState(Object entity, Type[] types, Object[] state, SessionFactory sf) {
    // copy the entity state into the state array and return true if the state has changed
    ClassMetadata metadata = sf.getClassMetadata( entity.getClass() );
    Object[] newState = metadata.getPropertyValues( entity );
    int size = newState.length;
    boolean isDirty = false;
    for ( int index = 0; index < size ; index++ ) {
      if ( !types[index].isEqual( state[index], newState[index] ) ) {
        isDirty = true;
        state[index] = newState[index];
      }
    }
    return isDirty;
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

  /**
   * copy the entity state into the state array and return true if the state has changed
   */
  private boolean copyState(Object entity, Type[] types, Object[] state, SessionFactory sf) {
    ClassMetadata metadata = sf.getClassMetadata( entity.getClass() );
    Object[] newState = metadata.getPropertyValues( entity, EntityMode.POJO );
    int size = newState.length;
    boolean isDirty = false;
    for ( int index = 0; index < size ; index++ ) {
      if ( !types[index].isEqual( state[index], newState[index], EntityMode.POJO ) ) {
        isDirty = true;
        state[index] = newState[index];
      }
    }
    return isDirty;
  }
}
origin: hibernate/hibernate-entitymanager

  /**
   * copy the entity state into the state array and return true if the state has changed
   */
  private boolean copyState(Object entity, Type[] types, Object[] state, SessionFactory sf) {
    ClassMetadata metadata = sf.getClassMetadata( entity.getClass() );
    Object[] newState = metadata.getPropertyValues( entity, EntityMode.POJO );
    int size = newState.length;
    boolean isDirty = false;
    for ( int index = 0; index < size ; index++ ) {
      if ( !types[index].isEqual( state[index], newState[index], EntityMode.POJO ) ) {
        isDirty = true;
        state[index] = newState[index];
      }
    }
    return isDirty;
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

/**
 * @param entity an actual entity object, not a proxy!
 */
public String toString(Object entity, EntityMode entityMode) throws HibernateException {
  // todo : this call will not work for anything other than pojos!
  ClassMetadata cm = factory.getClassMetadata( entity.getClass() );
  if ( cm==null ) return entity.getClass().getName();
  Map result = new HashMap();
  if ( cm.hasIdentifierProperty() ) {
    result.put(
      cm.getIdentifierPropertyName(),
      cm.getIdentifierType().toLoggableString( cm.getIdentifier( entity, entityMode ), factory )
    );
  }
  Type[] types = cm.getPropertyTypes();
  String[] names = cm.getPropertyNames();
  Object[] values = cm.getPropertyValues( entity, entityMode );
  for ( int i=0; i<types.length; i++ ) {
    if ( !names[i].startsWith("_") ) {
      String strValue = values[i]==LazyPropertyInitializer.UNFETCHED_PROPERTY ?
        values[i].toString() :
        types[i].toLoggableString( values[i], factory );
      result.put( names[i], strValue );
    }
  }
  return cm.getEntityName() + result.toString();
}
origin: hibernate/hibernate

/**
 * @param entity an actual entity object, not a proxy!
 */
public String toString(Object entity, EntityMode entityMode) throws HibernateException {
  // todo : this call will not work for anything other than pojos!
  ClassMetadata cm = factory.getClassMetadata( entity.getClass() );
  if ( cm==null ) return entity.getClass().getName();
  Map result = new HashMap();
  if ( cm.hasIdentifierProperty() ) {
    result.put(
      cm.getIdentifierPropertyName(),
      cm.getIdentifierType().toLoggableString( cm.getIdentifier( entity, entityMode ), factory )
    );
  }
  Type[] types = cm.getPropertyTypes();
  String[] names = cm.getPropertyNames();
  Object[] values = cm.getPropertyValues( entity, entityMode );
  for ( int i=0; i<types.length; i++ ) {
    if ( !names[i].startsWith("_") ) {
      String strValue = values[i]==LazyPropertyInitializer.UNFETCHED_PROPERTY ?
        values[i].toString() :
        types[i].toLoggableString( values[i], factory );
      result.put( names[i], strValue );
    }
  }
  return cm.getEntityName() + result.toString();
}
origin: omero/server

public IObject[] getLockCandidates(IObject o) {
  int idx = 0;
  IObject[] toCheck = new IObject[total()];
  Object[] values = cm.getPropertyValues(o, EntityMode.POJO);
  for (int i = 0; i < size(); i++) {
    if (!include(i)) {
org.hibernate.metadataClassMetadatagetPropertyValues

Javadoc

Extract the property values from the given entity.

Popular methods of ClassMetadata

  • getIdentifierPropertyName
    Get the name of the identifier property (or return null)
  • getIdentifierType
    Get the identifier Hibernate type
  • getEntityName
    The name of the entity
  • getPropertyNames
    Get the names of the class' persistent properties
  • getMappedClass
    The persistent class, or null
  • getIdentifier
  • getPropertyType
    Get the type of a particular (named) property
  • getPropertyTypes
    Get the Hibernate types of the class properties
  • getPropertyValue
    Get the value of a particular (named) property
  • hasIdentifierProperty
    Does this class have an identifier property?
  • setPropertyValue
    Set the value of a particular (named) property
  • instantiate
  • setPropertyValue,
  • instantiate,
  • getVersionProperty,
  • setIdentifier,
  • getPropertyNullability,
  • getVersion,
  • isVersioned,
  • getNaturalIdentifierProperties,
  • getPropertyLaziness

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • PhpStorm for WordPress
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