Package org.hibernate.mapping

Examples of org.hibernate.mapping.ToOne


        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 ) {
            try {
              parentPropIter = ( (Component) referencedPc.getRecursiveProperty( toOne.getReferencedPropertyName() ).getValue() ).getPropertyIterator();
            } catch (ClassCastException e) {
              throw new MappingException("dotted notation reference neither a component nor a many/one to one", e);
            }
          }
          else {
View Full Code Here


        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 ) {
            try {
              parentPropIter = ( (Component) referencedPc.getRecursiveProperty( toOne.getReferencedPropertyName() ).getValue() ).getPropertyIterator();
            } catch (ClassCastException e) {
              throw new MappingException("dotted notation reference neither a component nor a many/one to one", e);
            }
          }
          else {
View Full Code Here

    value.setTypeUsingReflection( className, propertyName );

    // this is done here 'cos we might only know the type here (ugly!)
    // TODO: improve this a lot:
    if ( value instanceof ToOne ) {
      ToOne toOne = (ToOne) value;
      String propertyRef = toOne.getReferencedPropertyName();
      if ( propertyRef != null ) {
        mappings.addUniquePropertyReference( toOne.getReferencedEntityName(), propertyRef );
      }
    }
    else if ( value instanceof Collection ) {
      Collection coll = (Collection) value;
      String propertyRef = coll.getReferencedPropertyName();
View Full Code Here

        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 ) {
            try {
              parentPropIter = ( (Component) referencedPc.getRecursiveProperty( toOne.getReferencedPropertyName() ).getValue() ).getPropertyIterator();
            } catch (ClassCastException e) {
              throw new MappingException("dotted notation reference neither a component nor a many/one to one", e);
            }
          }
          else {
View Full Code Here

        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 ) {
            try {
              parentPropIter = ( (Component) referencedPc.getRecursiveProperty( toOne.getReferencedPropertyName() ).getValue() ).getPropertyIterator();
            } catch (ClassCastException e) {
              throw new MappingException("dotted notation reference neither a component nor a many/one to one", e);
            }
          }
          else {
View Full Code Here

        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 ) {
            try {
              parentPropIter = ( (Component) referencedPc.getRecursiveProperty( toOne.getReferencedPropertyName() ).getValue() ).getPropertyIterator();
            } catch (ClassCastException e) {
              throw new MappingException("dotted notation reference neither a component nor a many/one to one", e);
            }
          }
          else {
View Full Code Here

    value.setTypeUsingReflection( className, propertyName );

    // this is done here 'cos we might only know the type here (ugly!)
    // TODO: improve this a lot:
    if ( value instanceof ToOne ) {
      ToOne toOne = (ToOne) value;
      String propertyRef = toOne.getReferencedPropertyName();
      if ( propertyRef != null ) {
        mappings.addUniquePropertyReference( toOne.getReferencedEntityName(), propertyRef );
      }
      toOne.setCascadeDeleteEnabled( "cascade".equals( subnode.attributeValue( "on-delete" ) ) );
    }
    else if ( value instanceof Collection ) {
      Collection coll = (Collection) value;
      String propertyRef = coll.getReferencedPropertyName();
      // not necessarily a *unique* property reference
View Full Code Here

        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 ) {
            try {
              parentPropIter = ( (Component) referencedPc.getRecursiveProperty( toOne.getReferencedPropertyName() ).getValue() ).getPropertyIterator();
            } catch (ClassCastException e) {
              throw new MappingException("dotted notation reference neither a component nor a many/one to one", e);
            }
          }
          else {
View Full Code Here

    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 ) {
        try {
          parentPropIter = ( (Component) referencedPc.getRecursiveProperty(
              toOne.getReferencedPropertyName()
          ).getValue() ).getPropertyIterator();
        }
        catch (ClassCastException e) {
          throw new MappingException(
              "dotted notation reference neither a component nor a many/one to one", e
View Full Code Here

    value.setTypeUsingReflection( className, propertyName );

    // this is done here 'cos we might only know the type here (ugly!)
    // TODO: improve this a lot:
    if ( value instanceof ToOne ) {
      ToOne toOne = (ToOne) value;
      String propertyRef = toOne.getReferencedPropertyName();
      if ( propertyRef != null ) {
        mappings.addUniquePropertyReference( toOne.getReferencedEntityName(), propertyRef );
      }
    }
    else if ( value instanceof Collection ) {
      Collection coll = (Collection) value;
      String propertyRef = coll.getReferencedPropertyName();
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.ToOne

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.