Package org.hibernate.tool.hbm2x.pojo

Examples of org.hibernate.tool.hbm2x.pojo.EntityPOJOClass$IteratorTransformer


  public POJOClass getPOJOClass(Component comp) {   
    return new ComponentPOJOClass(comp, this);
  }
 
  public POJOClass getPOJOClass(PersistentClass comp) {   
    return new EntityPOJOClass(comp, this);
  }
View Full Code Here


            prefix = "";
        }
       
        // Add superclass's properties too
        while (cmd != null){
          EntityPOJOClass pc = new EntityPOJOClass(cmd, new Cfg2JavaTool()); // TODO: we should extract the needed functionallity from this hbm2java class.
           
          Iterator allPropertiesIterator = pc.getAllPropertiesIterator();
            while ( allPropertiesIterator.hasNext() ) {
          Property property = (Property) allPropertiesIterator.next();
          String candidate = property.getName();
            if (prefix.length() == 0 || candidate.toLowerCase().startsWith(prefix.toLowerCase())) {
              HQLCompletionProposal proposal = createStartWithCompletionProposal( prefix, cursorPosition, HQLCompletionProposal.PROPERTY, candidate );
View Full Code Here

  public POJOClass getPOJOClass(Component comp) {   
    return new ComponentPOJOClass(comp, this);
  }
 
  public POJOClass getPOJOClass(PersistentClass comp) {   
    return new EntityPOJOClass(comp, this);
  }
View Full Code Here

      }
      else
      {
         if (element instanceof EntityPOJOClass)
         {
            EntityPOJOClass epc = (EntityPOJOClass) element;
            Object object = epc.getDecoratedObject();
            if (object instanceof PersistentClass)
            {
               PersistentClass pc = (PersistentClass) object;
               Table table = pc.getTable();
               if (selection.contains(table.getName()))
View Full Code Here

      }
      else
      {
         if (element instanceof EntityPOJOClass)
         {
            EntityPOJOClass epc = (EntityPOJOClass) element;
            Object object = epc.getDecoratedObject();
            if (object instanceof PersistentClass)
            {
               PersistentClass pc = (PersistentClass) object;
               Table table = pc.getTable();
               if (selection.contains(table.getName()))
View Full Code Here

      }
      else
      {
         if (element instanceof EntityPOJOClass)
         {
            EntityPOJOClass epc = (EntityPOJOClass) element;
            Object object = epc.getDecoratedObject();
            if (object instanceof PersistentClass)
            {
               PersistentClass pc = (PersistentClass) object;
               Table table = pc.getTable();
               if (selection.contains(table.getName()))
View Full Code Here

      }
      else
      {
         if (element instanceof EntityPOJOClass)
         {
            EntityPOJOClass epc = (EntityPOJOClass) element;
            Object object = epc.getDecoratedObject();
            if (object instanceof PersistentClass)
            {
               PersistentClass pc = (PersistentClass) object;
               Table table = pc.getTable();
               if (selection.contains(table.getName()))
View Full Code Here

   
  }
 
 
  public void testMinimal() {
    POJOClass bp = new EntityPOJOClass(getCfg().getClassMapping("BrandProduct"), new Cfg2JavaTool());
   
    List propertiesForMinimalConstructor = bp.getPropertiesForMinimalConstructor();
   
    assertEquals(1,propertiesForMinimalConstructor.size());
   
    List propertiesForFullConstructor = bp.getPropertiesForFullConstructor();
   
    assertEquals(2, propertiesForFullConstructor.size());   
  }
View Full Code Here

      
       foreignKey = getForeignKey(vehicleTable, identifier("vehicle_modelyear"));
       assertEquals(foreignKey.getColumnSpan(), 3);
      
       PersistentClass vehicle = getConfiguration().getClassMapping("Vehicle");
       EntityPOJOClass vechiclePojo = new EntityPOJOClass(vehicle, new Cfg2JavaTool());
       assertNotNull(vechiclePojo.getDecoratedObject());
      
       Property property = vehicle.getProperty("modelyear");
       assertNotNull(property);
       String generateJoinColumnsAnnotation = vechiclePojo.generateJoinColumnsAnnotation(property, cfg);
       assertTrue(generateJoinColumnsAnnotation.indexOf("referencedColumnName=\"MAKE\"")>0);
     
      
     }
View Full Code Here

 
  public void testEmptyCascade() {
    PersistentClass classMapping = getCfg().getClassMapping("org.hibernate.tool.hbm2x.Article");
   
    Cfg2JavaTool cfg2java = new Cfg2JavaTool();
    EntityPOJOClass clazz = (EntityPOJOClass) cfg2java.getPOJOClass(classMapping);
    Property property = classMapping.getProperty( "author" );
   
    assertEquals(0, clazz.getCascadeTypes( property ).length);
   
    assertEquals(null,findFirstString( "cascade={}", new File(getOutputDir(), "org/hibernate/tool/hbm2x/Article.java") ));
  }
View Full Code Here

TOP

Related Classes of org.hibernate.tool.hbm2x.pojo.EntityPOJOClass$IteratorTransformer

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.