Package org.hibernate.mapping

Examples of org.hibernate.mapping.Property


            false
          );
      }

      if ( value != null ) {
        Property prop = createProperty( value, propertyName, persistentClass
          .getEntityName(), subnode, mappings, inheritedMetas );
        prop.setOptional( join.isOptional() );
        join.addProperty( prop );
      }

    }
View Full Code Here


          mappings,
          inheritedMetas,
          true
        );
      persistentClass.setIdentifierMapper(mapper);
      Property property = new Property();
      property.setName("_identifierMapper");
      property.setNodeName("id");
      property.setUpdateable(false);
      property.setInsertable(false);
      property.setValue(mapper);
      property.setPropertyAccessorName( "embedded" );
      persistentClass.addProperty(property);
    }

  }
View Full Code Here

      else if ( "parent".equals( name ) ) {
        component.setParentProperty( propertyName );
      }

      if ( value != null ) {
        Property property = createProperty( value, propertyName, component
          .getComponentClassName(), subnode, mappings, inheritedMetas );
        if (isIdentifierMapper) {
          property.setInsertable(false);
          property.setUpdateable(false);
        }
        component.addProperty( property );
      }
    }
View Full Code Here

      else if ( "resultset".equals(name) ) {
        bindResultSetMappingDefinition( subnode, persistentClass.getEntityName(), mappings );
      }

      if ( value != null ) {
        Property property = createProperty( value, propertyName, persistentClass
          .getClassName(), subnode, mappings, inheritedMetas );
        if ( !mutable ) property.setUpdateable(false);
        if ( naturalId ) property.setNaturalIdentifier(true);
        persistentClass.addProperty( property );
        if ( uniqueKey!=null ) uniqueKey.addColumns( property.getColumnIterator() );
      }

    }
  }
View Full Code Here

        mappings.addPropertyReference( coll.getOwnerEntityName(), propertyRef );
      }
    }

    value.createForeignKey();
    Property prop = new Property();
    prop.setValue( value );
    bindProperty( subnode, prop, mappings, inheritedMetas );
    return prop;
  }
View Full Code Here

    boolean foundInsertGeneratedValue = false;
    boolean foundUpdateGeneratedValue = false;
    boolean foundUpdateableNaturalIdProperty = false;

    while ( iter.hasNext() ) {
      Property prop = ( Property ) iter.next();

      if ( prop == persistentClass.getVersion() ) {
        tempVersionProperty = i;
        properties[i] = PropertyFactory.buildVersionProperty( prop, lazyAvailable );
      }
      else {
        properties[i] = PropertyFactory.buildStandardProperty( prop, lazyAvailable );
      }

      if ( prop.isNaturalIdentifier() ) {
        naturalIdNumbers.add( new Integer(i) );
        if ( prop.isUpdateable() ) {
          foundUpdateableNaturalIdProperty = true;
        }
      }

      if ( "id".equals( prop.getName() ) ) {
        foundNonIdentifierPropertyNamedId = true;
      }

      // temporary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      boolean lazy = prop.isLazy() && lazyAvailable;
      if ( lazy ) hasLazy = true;
      propertyLaziness[i] = lazy;

      propertyNames[i] = properties[i].getName();
      propertyTypes[i] = properties[i].getType();
View Full Code Here

  }

  private boolean hasPartialInsertComponentGeneration(Component component) {
    Iterator subProperties = component.getPropertyIterator();
    while ( subProperties.hasNext() ) {
      Property prop = ( Property ) subProperties.next();
      if ( prop.getGeneration() == PropertyGeneration.ALWAYS || prop.getGeneration() == PropertyGeneration.INSERT ) {
        return true;
      }
      else if ( prop.getValue() instanceof Component ) {
        if ( hasPartialInsertComponentGeneration( ( Component ) prop.getValue() ) ) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

  }

  private boolean hasPartialUpdateComponentGeneration(Component component) {
    Iterator subProperties = component.getPropertyIterator();
    while ( subProperties.hasNext() ) {
      Property prop = ( Property ) subProperties.next();
      if ( prop.getGeneration() == PropertyGeneration.ALWAYS ) {
        return true;
      }
      else if ( prop.getValue() instanceof Component ) {
        if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

  private void mapPropertyToIndex(Property prop, int i) {
    propertyIndexes.put( prop.getName(), new Integer(i) );
    if ( prop.getValue() instanceof Component ) {
      Iterator iter = ( (Component) prop.getValue() ).getPropertyIterator();
      while ( iter.hasNext() ) {
        Property subprop = (Property) iter.next();
        propertyIndexes.put(
            prop.getName() + '.' + subprop.getName(),
            new Integer(i)
          );
      }
    }
  }
View Full Code Here

    propertyTableNumbers = new int[ getPropertySpan() ];
    Iterator iter = persistentClass.getPropertyClosureIterator();
    int i=0;
    while( iter.hasNext() ) {
      Property prop = (Property) iter.next();
      propertyTableNumbers[i++] = persistentClass.getJoinNumber(prop);

    }

    //TODO: code duplication with JoinedSubclassEntityPersister
   
    ArrayList columnJoinNumbers = new ArrayList();
    ArrayList formulaJoinedNumbers = new ArrayList();
    ArrayList propertyJoinNumbers = new ArrayList();
   
    iter = persistentClass.getSubclassPropertyClosureIterator();
    while ( iter.hasNext() ) {
      Property prop = (Property) iter.next();
      Integer join = new Integer( persistentClass.getJoinNumber(prop) );
      propertyJoinNumbers.add(join);

      //propertyTableNumbersByName.put( prop.getName(), join );
      propertyTableNumbersByNameAndSubclass.put(
          prop.getPersistentClass().getEntityName() + '.' + prop.getName(),
          join
      );

      Iterator citer = prop.getColumnIterator();
      while ( citer.hasNext() ) {
        Selectable thing = (Selectable) citer.next();
        if ( thing.isFormula() ) {
          formulaJoinedNumbers.add(join);
        }
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.Property

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.