Package org.hibernate

Examples of org.hibernate.EntityMode


    return null;
  }

  void process(Object object, EntityPersister persister) throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
    Object[] values = persister.getPropertyValues( object, entityMode );
    Type[] types = persister.getPropertyTypes();
    processEntityPropertyValues(values, types);
    if ( isSubstitutionRequired() ) {
      persister.setPropertyValues( object, values, entityMode );
View Full Code Here


    }

    iter = node.elementIterator( "tuplizer" );
    while ( iter.hasNext() ) {
      final Element tuplizerElem = ( Element ) iter.next();
      EntityMode mode = EntityMode.parse( tuplizerElem.attributeValue( "entity-mode" ) );
      component.addTuplizer( mode, tuplizerElem.attributeValue( "class" ) );
    }
  }
View Full Code Here

   
    EntityPersister persister = factory.getEntityPersister( associatedEntityName );
    StringBuffer result = new StringBuffer().append( associatedEntityName );

    if ( persister.hasIdentifierProperty() ) {
      final EntityMode entityMode = persister.guessEntityMode( value );
      final Serializable id;
      if ( entityMode == null ) {
        if ( isEmbeddedInXML ) {
          throw new ClassCastException( value.getClass().getName() );
        }
View Full Code Here

    this.array = array;
    setInitialized();
  }

  public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {
    EntityMode entityMode = getSession().getEntityMode();
    int length = /*(array==null) ? tempList.size() :*/ Array.getLength(array);
    Serializable result = (Serializable) Array.newInstance( persister.getElementClass(), length );
    for ( int i=0; i<length; i++ ) {
      Object elt = /*(array==null) ? tempList.get(i) :*/ Array.get(array, i);
      try {
View Full Code Here

    // then handle any user-defined entity modes...
    if ( !userSuppliedTuplizerImpls.isEmpty() ) {
      Iterator itr = userSuppliedTuplizerImpls.entrySet().iterator();
      while ( itr.hasNext() ) {
        final Map.Entry entry = ( Map.Entry ) itr.next();
        final EntityMode entityMode = ( EntityMode ) entry.getKey();
        final String userTuplizerClassName = ( String ) entry.getValue();
        ComponentTuplizer tuplizer = componentTuplizerFactory.constructTuplizer( userTuplizerClassName, component );
        addTuplizer( entityMode, tuplizer );
      }
    }
View Full Code Here

  }

  public Serializable getSnapshot(CollectionPersister persister)
    throws HibernateException {

    EntityMode entityMode = getSession().getEntityMode();

    HashMap map = new HashMap( values.size() );
    Iterator iter = values.iterator();
    int i=0;
    while ( iter.hasNext() ) {
View Full Code Here

      return false;
    }
    if ( x == null || y == null ) {
      return true;
    }
    EntityMode entityMode = session.getEntityMode();
    Object[] xvalues = getPropertyValues( x, entityMode );
    Object[] yvalues = getPropertyValues( y, entityMode );
    for ( int i = 0; i < xvalues.length; i++ ) {
      if ( propertyTypes[i].isDirty( xvalues[i], yvalues[i], session ) ) {
        return true;
View Full Code Here

      return false;
    }
    if ( x == null || y == null ) {
      return true;
    }
    EntityMode entityMode = session.getEntityMode();
    Object[] xvalues = getPropertyValues( x, entityMode );
    Object[] yvalues = getPropertyValues( y, entityMode );
    int loc = 0;
    for ( int i = 0; i < xvalues.length; i++ ) {
      int len = propertyTypes[i].getColumnSpan( session.getFactory() );
View Full Code Here

      throws HibernateException {
    if ( value == null ) {
      return "null";
    }
    Map result = new HashMap();
    EntityMode entityMode = tuplizerMapping.guessEntityMode( value );
    if ( entityMode == null ) {
      throw new ClassCastException( value.getClass().getName() );
    }
    Object[] values = getPropertyValues( value, entityMode );
    for ( int i = 0; i < propertyTypes.length; i++ ) {
View Full Code Here

    final Object result = target == null
        ? instantiate( owner, session )
        : target;

    final EntityMode entityMode = session.getEntityMode();
    Object[] values = TypeFactory.replace(
        getPropertyValues( original, entityMode ),
        getPropertyValues( result, entityMode ),
        propertyTypes,
        session,
View Full Code Here

TOP

Related Classes of org.hibernate.EntityMode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.