Package org.hibernate.mapping

Examples of org.hibernate.mapping.Component


      List<Property> properties = findPropertiesByColumns( columnOwner, columns, mappings );
      //create an embeddable component
      Property synthProp = null;
      if ( properties != null ) {
        //todo how about properties.size() == 1, this should be much simpler
        Component embeddedComp = columnOwner instanceof PersistentClass ?
            new Component( (PersistentClass) columnOwner ) :
            new Component( (Join) columnOwner );
        embeddedComp.setEmbedded( true );
        embeddedComp.setNodeName( syntheticPropertyName );
        embeddedComp.setComponentClassName( embeddedComp.getOwner().getClassName() );
        for (Property property : properties) {
          Property clone = BinderHelper.shallowCopy( property );
          clone.setInsertable( false );
          clone.setUpdateable( false );
          clone.setNaturalIdentifier( false );
          embeddedComp.addProperty( clone );
        }
        synthProp = new Property();
        synthProp.setName( syntheticPropertyName );
        synthProp.setNodeName( syntheticPropertyName );
        synthProp.setPersistentClass( ownerEntity );
View Full Code Here


  private Iterator getSubPropertyIterator(PersistentClass pc, String reducedName) {
    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

        }

        //boolean propertyAccess = embeddable == null || AccessType.PROPERTY.equals( embeddable.access() );
        PropertyData inferredData = new PropertyPreloadedData( "property", "element", elementClass );
        //TODO be smart with isNullable
        Component component = AnnotationBinder.fillComponent(
            holder, inferredData, isPropertyAnnotated, isPropertyAnnotated ? "property" : "field", true,
            entityBinder, false, false,
            true, mappings
        );
View Full Code Here

    }
    else {
      proxyFactory = null;
    }
   
    Component mapper = mappingInfo.getIdentifierMapper();
    identifierMapperType = mapper==null ? null : (AbstractComponentType) mapper.getType();
  }
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.