Package org.hibernate.mapping

Examples of org.hibernate.mapping.PersistentClass


      columnIterator = property.getColumnIterator();
    }

    if(property.getValue() instanceof ToOne) {
      String referencedEntityName = ((ToOne)property.getValue()).getReferencedEntityName();
      PersistentClass target = cfg.getClassMapping(referencedEntityName);
      if(target!=null) {
        referencedColumnsIterator = target.getKey().getColumnIterator();
      }
    }

    StringBuffer annotations = new StringBuffer( "    " );
    if ( span == 1 ) {
View Full Code Here


    Set joinColumns = new HashSet();
    while ( joinColumnsIt.hasNext() ) {
      joinColumns.add( joinColumnsIt.next() );
    }
    ManyToOne manyToOne = (ManyToOne) collection.getElement();
    PersistentClass pc = cfg.getClassMapping( manyToOne.getReferencedEntityName() );
    Iterator properties = pc.getPropertyClosureIterator();
    //TODO we should check the table too
    boolean isOtherSide = false;
    mappedBy = "unresolved";
    while ( ! isOtherSide && properties.hasNext() ) {
      Property collectionProperty = (Property) properties.next();
View Full Code Here

    Set joinColumns = new HashSet();
    while ( joinColumnsIt.hasNext() ) {
      joinColumns.add( joinColumnsIt.next() );
    }
    OneToMany oneToMany = (OneToMany) collection.getElement();
    PersistentClass pc = cfg.getClassMapping( oneToMany.getReferencedEntityName() );
    Iterator properties = pc.getPropertyClosureIterator();
    //TODO we should check the table too
    boolean isOtherSide = false;
    mappedBy = "unresolved";
    while ( ! isOtherSide && properties.hasNext() ) {
      Property manyProperty = (Property) properties.next();
View Full Code Here

    Iterator joinColumnsIt = oneToOne.getColumnIterator();
    Set joinColumns = new HashSet();
    while ( joinColumnsIt.hasNext() ) {
      joinColumns.add( joinColumnsIt.next() );
    }
    PersistentClass pc = cfg.getClassMapping( oneToOne.getReferencedEntityName() );
    String referencedPropertyName = oneToOne.getReferencedPropertyName();
    if ( referencedPropertyName != null )
      return referencedPropertyName;

    Iterator properties = pc.getPropertyClosureIterator();
    //TODO we should check the table too
    boolean isOtherSide = false;
    mappedBy = "unresolved";

View Full Code Here

        }
       
    if(getConfiguration()!=null) {
        Iterator classMappings = getConfiguration().getClassMappings();
        while (classMappings.hasNext() ) {
            PersistentClass element = (PersistentClass) classMappings.next();
            if(element instanceof RootClass) {
                dump(pw, ejb3, element);
            }
        }
    }
View Full Code Here

      pw.println("<mapping resource=\"" + getMappingFileResource(element) + "\"/>");
    }
     
    Iterator directSubclasses = element.getDirectSubclasses();
    while (directSubclasses.hasNext() ) {
      PersistentClass subclass = (PersistentClass) directSubclasses.next();
      dump(pw, useClass, subclass);   
    }
   
  }
View Full Code Here

       
        Map components = new HashMap();

        Iterator classesItr = cfg.getClassMappings();
        while (classesItr.hasNext() ) {
            PersistentClass clazz = (PersistentClass) classesItr.next();
           
            POJOClass pojoClazz = cfg2JavaTool.getPOJOClass(clazz);
            ConfigurationNavigator.collectComponents(components, pojoClazz);           
           
            this.processClass(pojoClazz);
           
            Iterator properties = clazz.getPropertyIterator();
            while (properties.hasNext() ) {
                Property property = (Property) properties.next();
                Value value = property.getValue();               
                List props = (List) propsByValue.get(value);
                if (props == null) {
View Full Code Here

    if(entityName==null) {
      throw new MappingException( "<return alias='" + alias + "'> must specify either a class or entity-name");
    }
    LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) );

    PersistentClass pc = mappings.getClass( entityName );
    java.util.Map propertyResults = bindPropertyResults(alias, returnElem, pc, mappings );

    return new NativeSQLQueryRootReturn(
        alias,
        entityName,
View Full Code Here

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

    String defaultCatalog = getSettings().getDefaultCatalogName();
    String defaultSchema = getSettings().getDefaultSchemaName();

    Iterator iter = cfg.getClassMappings();
    while ( iter.hasNext() ) {
      PersistentClass pc = (PersistentClass) iter.next();

      if ( !pc.isInherited() ) {

        IdentifierGenerator ig = pc.getIdentifier()
            .createIdentifierGenerator(
                cfg.getIdentifierGeneratorFactory(),
                dialect,
                defaultCatalog,
                defaultSchema,
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.PersistentClass

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.