Package org.hibernate.mapping

Examples of org.hibernate.mapping.OneToOne


      else if ( "any".equals( name ) ) {
        value = new Any( mappings, table );
        bindAny( subnode, (Any) value, nullable, mappings );
      }
      else if ( "one-to-one".equals( name ) ) {
        value = new OneToOne( mappings, table, persistentClass );
        bindOneToOne( subnode, (OneToOne) value, propertyName, true, mappings );
      }
      else if ( "property".equals( name ) ) {
        value = new SimpleValue( mappings, table );
        bindSimpleValue( subnode, (SimpleValue) value, nullable, propertyName, mappings );
View Full Code Here


    new IdentifierBag(null).accept(vv);
    new List(null).accept(vv);
    new ManyToOne(null).accept(vv);
    new Map(null).accept(vv);
    new OneToMany(null).accept(vv);
    new OneToOne(null, new RootClass() ).accept(vv);
    new PrimitiveArray(null).accept(vv);
    new Set(null).accept(vv);
    new SimpleValue().accept(vv);
 
   
View Full Code Here

    }

    @SuppressWarnings({"unchecked"})
    void addOneToOneNotOwning(PropertyAuditingData propertyAuditingData, Value value,
                              CompositeMapperBuilder mapper, String entityName) {
        OneToOne propertyValue = (OneToOne) value;

        String owningReferencePropertyName = propertyValue.getReferencedPropertyName(); // mappedBy

        EntityConfiguration configuration = mainGenerator.getEntitiesConfigurations().get(entityName);
        if (configuration == null) {
            throw new MappingException("An audited relation to a non-audited entity " + entityName + "!");
        }

        IdMappingData ownedIdMapping = configuration.getIdMappingData();

        if (ownedIdMapping == null) {
            throw new MappingException("An audited relation to a non-audited entity " + entityName + "!");
        }

        String lastPropertyPrefix = MappingTools.createToOneRelationPrefix(owningReferencePropertyName);
        String referencedEntityName = propertyValue.getReferencedEntityName();

        // Generating the id mapper for the relation
        IdMapper ownedIdMapper = ownedIdMapping.getIdMapper().prefixMappedProperties(lastPropertyPrefix);

        // Storing information about this relation
View Full Code Here

  void addOneToOneNotOwning(
      PropertyAuditingData propertyAuditingData,
      Value value,
      CompositeMapperBuilder mapper,
      String entityName) {
    final OneToOne propertyValue = (OneToOne) value;
    final String owningReferencePropertyName = propertyValue.getReferencedPropertyName();

    final EntityConfiguration configuration = mainGenerator.getEntitiesConfigurations().get( entityName );
    if ( configuration == null ) {
      throw new MappingException( "An audited relation to a non-audited entity " + entityName + "!" );
    }

    final IdMappingData ownedIdMapping = configuration.getIdMappingData();

    if ( ownedIdMapping == null ) {
      throw new MappingException( "An audited relation to a non-audited entity " + entityName + "!" );
    }

    final String lastPropertyPrefix = MappingTools.createToOneRelationPrefix( owningReferencePropertyName );
    final String referencedEntityName = propertyValue.getReferencedEntityName();

    // Generating the id mapper for the relation
    final IdMapper ownedIdMapper = ownedIdMapping.getIdMapper().prefixMappedProperties( lastPropertyPrefix );

    // Storing information about this relation
View Full Code Here

          entityName,
          insertable
      );
    }
    else if ( type instanceof OneToOneType ) {
      final OneToOne oneToOne = (OneToOne) value;
      if ( oneToOne.getReferencedPropertyName() != null ) {
        toOneRelationMetadataGenerator.addOneToOneNotOwning(
            propertyAuditingData,
            value,
            currentMapper,
            entityName
View Full Code Here

          relativePath = subpath.substring( component.getOwner().getEntityName().length() + 1 );
        }
        bindManyToOne( subnode, (ManyToOne) value, relativePath, isNullable, mappings );
      }
      else if ( "one-to-one".equals( name ) ) {
        value = new OneToOne( mappings, component.getTable(), component.getOwner() );
        String relativePath;
        if (isEmbedded) {
          relativePath = propertyName;
        }
        else {
View Full Code Here

      else if ( "any".equals( name ) ) {
        value = new Any( mappings, table );
        bindAny( subnode, (Any) value, nullable, mappings );
      }
      else if ( "one-to-one".equals( name ) ) {
        value = new OneToOne( mappings, table, persistentClass );
        bindOneToOne( subnode, (OneToOne) value, propertyName, true, mappings );
      }
      else if ( "property".equals( name ) ) {
        value = new SimpleValue( mappings, table );
        bindSimpleValue( subnode, (SimpleValue) value, nullable, propertyName, mappings );
View Full Code Here

          relativePath = subpath.substring( component.getOwner().getEntityName().length() + 1 );
        }
        bindManyToOne( subnode, (ManyToOne) value, relativePath, isNullable, mappings );
      }
      else if ( "one-to-one".equals( name ) ) {
        value = new OneToOne( component.getTable(), component.getOwner() );
        String relativePath;
        if (isEmbedded) {
          relativePath = propertyName;
        }
        else {
View Full Code Here

      else if ( "any".equals( name ) ) {
        value = new Any( table );
        bindAny( subnode, (Any) value, nullable, mappings );
      }
      else if ( "one-to-one".equals( name ) ) {
        value = new OneToOne( table, persistentClass );
        bindOneToOne( subnode, (OneToOne) value, propertyName, true, mappings );
      }
      else if ( "property".equals( name ) ) {
        value = new SimpleValue( table );
        bindSimpleValue( subnode, (SimpleValue) value, nullable, propertyName, mappings );
View Full Code Here

    }

    @SuppressWarnings({"unchecked"})
    void addOneToOneNotOwning(PropertyAuditingData propertyAuditingData, Value value,
                              CompositeMapperBuilder mapper, String entityName) {
        OneToOne propertyValue = (OneToOne) value;

        String owningReferencePropertyName = propertyValue.getReferencedPropertyName(); // mappedBy

        EntityConfiguration configuration = mainGenerator.getEntitiesConfigurations().get(entityName);
        if (configuration == null) {
            throw new MappingException("An audited relation to a non-audited entity " + entityName + "!");
        }

        IdMappingData ownedIdMapping = configuration.getIdMappingData();

        if (ownedIdMapping == null) {
            throw new MappingException("An audited relation to a non-audited entity " + entityName + "!");
        }

        String lastPropertyPrefix = MappingTools.createToOneRelationPrefix(owningReferencePropertyName);
        String referencedEntityName = propertyValue.getReferencedEntityName();

        // Generating the id mapper for the relation
        IdMapper ownedIdMapper = ownedIdMapping.getIdMapper().prefixMappedProperties(lastPropertyPrefix);

        // Storing information about this relation
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.OneToOne

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.