Package org.hibernate.cfg

Examples of org.hibernate.cfg.Mappings$PropertyReference


    }

  };

  public void testProperCallbacks() {
    final Mappings mappings = new Configuration().createMappings();
    final Table tbl = new Table();
    final RootClass rootClass = new RootClass();

    ValueVisitor vv = new ValueVisitorValidator();
   
View Full Code Here


      AnnotationConfiguration config = new AnnotationConfiguration();
      config.setNamingStrategy(EJB3NamingStrategy.INSTANCE);
      config.addAnnotatedClass(A.class);
      config.addAnnotatedClass(AddressEntry.class);
      config.buildSessionFactory();
      Mappings mappings = config.createMappings();
      boolean foundIt = false;

      for ( Iterator iter = mappings.iterateTables(); iter.hasNext()) {
        Table table = (Table) iter.next();
        log.info("testWithEJB3NamingStrategy table = " + table.getName());
        if ( table.getName().equalsIgnoreCase("A_ADDRESS")) {
          foundIt = true;
        }
View Full Code Here

        config.setNamingStrategy(this.namingStrategy);
      }

      if (this.typeDefinitions != null) {
        // Register specified Hibernate type definitions.
        Mappings mappings = config.createMappings();
        for (int i = 0; i < this.typeDefinitions.length; i++) {
          TypeDefinitionBean typeDef = this.typeDefinitions[i];
          mappings.addTypeDef(typeDef.getTypeName(), typeDef.getTypeClass(), typeDef.getParameters());
        }
      }

      if (this.filterDefinitions != null) {
        // Register specified Hibernate FilterDefinitions.
View Full Code Here

        config.setNamingStrategy(this.namingStrategy);
      }

      if (this.typeDefinitions != null) {
        // Register specified Hibernate type definitions.
        Mappings mappings = config.createMappings();
        for (int i = 0; i < this.typeDefinitions.length; i++) {
          TypeDefinitionBean typeDef = this.typeDefinitions[i];
          mappings.addTypeDef(typeDef.getTypeName(), typeDef.getTypeClass(), typeDef.getParameters());
        }
      }

      if (this.filterDefinitions != null) {
        // Register specified Hibernate FilterDefinitions.
View Full Code Here

        config.setNamingStrategy(this.namingStrategy);
      }

      if (this.typeDefinitions != null) {
        // Register specified Hibernate type definitions.
        Mappings mappings = config.createMappings();
        for (int i = 0; i < this.typeDefinitions.length; i++) {
          TypeDefinitionBean typeDef = this.typeDefinitions[i];
          mappings.addTypeDef(typeDef.getTypeName(), typeDef.getTypeClass(), typeDef.getParameters());
        }
      }

      if (this.filterDefinitions != null) {
        // Register specified Hibernate FilterDefinitions.
View Full Code Here

   
   
    dropSQL = new ArrayList(TABLECOUNT);
    createSQL = new ArrayList(TABLECOUNT);
    Table lastTable = null;
    Mappings mappings = cfg.createMappings();
    for(int tablecount=0;tablecount<TABLECOUNT;tablecount++) {
      Table table = new Table("perftest" + tablecount);
      Column col = new Column("id");
      //FIXME
      SimpleValue sv = new SimpleValue(mappings, table);
View Full Code Here

   
    r.append(getPkName(o)).append(SEPARADOR_CAMPOS_DADOS);
   
   
    Configuration conf = HibernateUtil.getConfiguration();
    Mappings map = conf.createMappings();
    //TODO: verificar se funcionar� apos mudan�a...
    Iterator itr = null;
   
    if (o!=null && o.getClass().getName()!=null && map.getClass(o.getClass().getName())!=null)
      itr = map.getClass(o.getClass().getName()).getPropertyIterator();
   
    while (itr!=null && itr.hasNext()) {
      Property prop = (Property) itr.next();
     
      String colname = prop.getName();
View Full Code Here

   * @return String    - Nome/valor da(s) chave(s)
   */
  private String getPkName(Object o) {
    StringBuffer r = new StringBuffer();
    Configuration conf = HibernateUtil.getConfiguration();
    Mappings map = conf.createMappings();
    if (o!=null && o.getClass().getName()!=null && map.getClass(o.getClass().getName())!=null) {
      Table tab = map.getClass(o.getClass().getName()).getTable();
      PrimaryKey pk = tab.getPrimaryKey();
      Iterator itr = pk.getColumnIterator();
      while (itr.hasNext()) {
        Column col = (Column) itr.next();
        String colname = col.getName();
View Full Code Here

   * @param Object o    - Objeto a ser descoberta a tabela
   * @return String    - Nome da tabela
   */
  private String getTableName(Object o) {
    Configuration conf = HibernateUtil.getConfiguration();
    Mappings map = conf.createMappings();
    Table tab = null;
    String tabela2 = null;
    if (o!=null && o.getClass().getName()!=null && map.getClass(o.getClass().getName())!=null) {
      tab = map.getClass(o.getClass().getName()).getTable();
      tabela2 = tab.getName();
    }


    return tabela2;
View Full Code Here

        config.setNamingStrategy(this.namingStrategy);
      }

      if (this.typeDefinitions != null) {
        // Register specified Hibernate type definitions.
        Mappings mappings = config.createMappings();
        for (TypeDefinitionBean typeDef : this.typeDefinitions) {
          mappings.addTypeDef(typeDef.getTypeName(), typeDef.getTypeClass(), typeDef.getParameters());
        }
      }

      if (this.filterDefinitions != null) {
        // Register specified Hibernate FilterDefinitions.
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.Mappings$PropertyReference

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.