Examples of Mappings


Examples of org.hibernate.cfg.Mappings

   
   
    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

Examples of org.hibernate.cfg.Mappings

   
    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

Examples of org.hibernate.cfg.Mappings

   * @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

Examples of org.hibernate.cfg.Mappings

   * @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

Examples of org.hibernate.cfg.Mappings

        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

Examples of org.netbeans.server.services.beans.Mappings

        public Mappings getMappings() {
            TreeMap<Integer, Integer> tmp = new TreeMap<Integer, Integer>();
            tmp.put(158498, 146264);
            tmp.put(158523, 146285);
            tmp.put(157884, 2081);
            return new Mappings(tmp);
        }
View Full Code Here

Examples of org.netbeans.server.services.beans.Mappings

    }

    public Mappings getMappings(){
        String url = SERVER_URL + RESOURCE_URL + "mappings";
        WebResource webResource = client.resource(url);
        Mappings result = webResource.get(Mappings.class);
        return result;
    }
View Full Code Here

Examples of org.netbeans.server.services.beans.Mappings

        assertFalse(comps.getSubcomponentsSet(someComp).isEmpty());
    }

    @Test
    public void testMappings() throws IOException {
        Mappings mps = new BugzillaConnector().getMappings();
        Map<Integer, Integer> mp = mps.getMappings();
        assertEquals(mp.get(158498).intValue(), 146264);
        assertEquals(mp.get(158523).intValue(), 146285);
        assertEquals(mp.get(157884).intValue(), 2081);
        assertEquals(mp.get(111307).intValue(), 108);
        assertEquals(mp.get(160098).intValue(), 147484);
View Full Code Here

Examples of org.netbeans.server.services.beans.Mappings

        return reporterUser;
    }

    void updateInTransferReports() {
        SYNCHRONIZATION_LOGGER.fine("cleaning in transfer");
        Mappings mappings = getMappings();
        if (mappings == null) {
            return;
        }
        Map<Integer, Integer> mappingMap = mappings.getMappings();
        //** reportId -> bugId  */
        final Map<Integer, Integer> reverseMap = new HashMap<Integer, Integer>();
        for (Entry<Integer, Integer> entry : mappingMap.entrySet()) {
            reverseMap.put(entry.getValue(), entry.getKey());
        }
View Full Code Here

Examples of org.netbeans.server.services.beans.Mappings

    void updateMappings() {
        SYNCHRONIZATION_LOGGER.fine("updating mappings");
        Utils.processPersistable(new Persistable.Transaction() {

            public TransactionResult runQuery(EntityManager em) throws Exception {
                Mappings mappings = getMappings();
                if (mappings == null){
                    return TransactionResult.ROLLBACK;
                }
                for (Entry<Integer, Integer> mappingEntry : mappings.getMappings().entrySet()) {
                    Integer bugId = mappingEntry.getKey();
                    Integer cfAutoreporterId = mappingEntry.getValue();
                    Report rep = em.find(Report.class, cfAutoreporterId);
                    if (rep == null) {
                        continue;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.