Package org.hibernate.mapping

Examples of org.hibernate.mapping.Component


    StringBuffer annotations = new StringBuffer( "    " );
    boolean insertable = property.isInsertable();
    boolean updatable = property.isUpdateable();
    if ( property.isComposite() ) {
      annotations.append( "@" + importType("javax.persistence.AttributeOverrides") +"( {" );
      Component component = (Component) property.getValue();
      Iterator subElements = component.getPropertyIterator();
      buildRecursiveAttributeOverride( subElements, null, property, annotations );
      annotations.setLength( annotations.length() - 2 );
      annotations.append( " } )" );
    }
    else {
View Full Code Here


        }
        else {
          path = "";
        }
        path = path + subProperty.getName();
        Component component = (Component) subProperty.getValue();
        buildRecursiveAttributeOverride( component.getPropertyIterator(), path, subProperty, annotations );
      }
      else {
        Iterator columns = subProperty.getColumnIterator();
        Selectable selectable = (Selectable) columns.next();
        if ( selectable.isFormula() ) {
View Full Code Here

    }
    if(field.getValue()!=null) {     
      if (!field.isOptional() && field.getGeneration().equals(PropertyGeneration.NEVER)) {       
        return true;
      } else if (field.getValue() instanceof Component) {
        Component c = (Component) field.getValue();
        Iterator it = c.getPropertyIterator();
        while ( it.hasNext() ) {
          Property prop = (Property) it.next();
          if(isRequiredInConstructor(prop)) {
            return true;
          }
View Full Code Here

        int dotIndex = name.lastIndexOf( '.' );
        String reducedName = name.substring( 0, dotIndex );
        Value value = pc.getRecursiveProperty( reducedName ).getValue();
        Iterator parentPropIter;
        if ( value instanceof Component ) {
          Component comp = (Component) value;
          parentPropIter = comp.getPropertyIterator();
        }
        else if ( value instanceof ToOne ) {
          ToOne toOne = (ToOne) value;
          PersistentClass referencedPc = mappings.getClass( toOne.getReferencedEntityName() );
          if ( toOne.getReferencedPropertyName() != null ) {
View Full Code Here

  }

  private static void bindCompositeId(Element idNode, RootClass entity, Mappings mappings,
      java.util.Map inheritedMetas) throws MappingException {
    String propertyName = idNode.attributeValue( "name" );
    Component id = new Component( entity );
    entity.setIdentifier( id );
    bindCompositeId( idNode, id, entity, propertyName, mappings, inheritedMetas );
    if ( propertyName == null ) {
      entity.setEmbeddedIdentifier( id.isEmbedded() );
      if ( id.isEmbedded() ) {
        // todo : what is the implication of this?
        id.setDynamic( !entity.hasPojoRepresentation() );
        /*
         * Property prop = new Property(); prop.setName("id");
         * prop.setPropertyAccessorName("embedded"); prop.setValue(id);
         * entity.setIdentifierProperty(prop);
         */
 
View Full Code Here

        value = new SimpleValue( table );
        bindSimpleValue( subnode, (SimpleValue) value, true, propertyName, mappings );
      }
      else if ( "component".equals( name ) || "dynamic-component".equals( name ) ) {
        String subpath = StringHelper.qualify( path, propertyName );
        value = new Component( join );
        bindComponent(
            subnode,
            (Component) value,
            join.getPersistentClass().getClassName(),
            propertyName,
View Full Code Here

    if ( "true".equals( node.attributeValue("mapped") ) ) {
      if ( propertyName!=null ) {
        throw new MappingException("cannot combine mapped=\"true\" with specified name");
      }
      Component mapper = new Component(persistentClass);
      bindComponent(
          node,
          mapper,
          persistentClass.getClassName(),
          null,
View Full Code Here

        bindSimpleValue( subnode, (SimpleValue) value, isNullable, relativePath, mappings );
      }
      else if ( "component".equals( name )
        || "dynamic-component".equals( name )
        || "nested-composite-element".equals( name ) ) {
        value = new Component( component ); // a nested composite element
        bindComponent(
            subnode,
            (Component) value,
            component.getComponentClassName(),
            propertyName,
View Full Code Here

      }
      else if ( "component".equals( name )
        || "dynamic-component".equals( name )
        || "properties".equals( name ) ) {
        String subpath = StringHelper.qualify( entityName, propertyName );
        value = new Component( persistentClass );

        bindComponent(
            subnode,
            (Component) value,
            persistentClass.getClassName(),
View Full Code Here

          );
        map.setIndex( mto );

      }
      else if ( "composite-index".equals( name ) || "composite-map-key".equals( name ) ) {
        Component component = new Component( map );
        bindComposite(
            subnode,
            component,
            map.getRole() + ".index",
            map.isOneToMany(),
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.Component

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.