Package org.takadb.editor.database.entities

Examples of org.takadb.editor.database.entities.RadicalEntity$Identifier


            }
            selectDestSequencesStmt.setString(1, endpointIdentifier);
           
            ResultSet res = selectDestSequencesStmt.executeQuery();
            while (res.next()) {
                Identifier sid = new Identifier();               
                sid.setValue(res.getString(1));
                EndpointReferenceType acksTo = RMUtils.createReference(res.getString(2))
                long lm = res.getLong(3);
                InputStream is = res.getBinaryStream(4);
                SequenceAcknowledgement ack = null;
                if (null != is) {
View Full Code Here


        control.verify();
    }
   
    @Test
    public void testGetSequence() {
        Identifier id = control.createMock(Identifier.class);
        String sid = "s1";
        EasyMock.expect(id.getValue()).andReturn(sid);
        control.replay();
        assertNull(destination.getSequence(id));
    }
View Full Code Here

            }
            selectSrcSequencesStmt.setString(1, endpointIdentifier);
            ResultSet res = selectSrcSequencesStmt.executeQuery();
           
            while (res.next()) {
                Identifier sid = new Identifier();
                sid.setValue(res.getString(1));
                long cmn = res.getLong(2);
                boolean lm = res.getBoolean(3);
                long lval = res.getLong(4);
                Date expiry = 0 == lval ? null : new Date(lval);
                String oidValue = res.getString(5);
                Identifier oi = null;
                if (null != oidValue) {
                    oi = new Identifier();
                    oi.setValue(oidValue);
                }                           
                SourceSequence seq = new SourceSequence(sid, expiry, oi, cmn, lm, protocol);
                seqs.add(seq);                         
            }
        } catch (SQLException ex) {
View Full Code Here

    @Test
    public void testAddRemoveSequence() {
        DestinationSequence ds = control.createMock(DestinationSequence.class);
        ds.setDestination(destination);
        EasyMock.expectLastCall();
        Identifier id = control.createMock(Identifier.class);
        EasyMock.expect(ds.getIdentifier()).andReturn(id).times(3);
        String sid = "s1";
        EasyMock.expect(id.getValue()).andReturn(sid).times(3);
        RMManager manager = control.createMock(RMManager.class);
        EasyMock.expect(rme.getManager()).andReturn(manager).times(2);       
        RMStore store = control.createMock(RMStore.class);
        EasyMock.expect(manager.getStore()).andReturn(store).times(2);
        store.createDestinationSequence(ds);
View Full Code Here

    String savePath = TakaEditorClientPreferences.getDataPath() + "/xml/radical/";
    new File(savePath).mkdirs();

    Iterator iter = getAllRadicals().iterator();
    while (iter.hasNext()) {
      RadicalEntity radical = (RadicalEntity)iter.next();
      radical.persist();
    }

  }
View Full Code Here

      // radicals
      System.out.println ("+ Saving radicals...");
      iter = this.dbcontroller.getAllRadicals().iterator();
      while (iter.hasNext()) {
        RadicalEntity iterRadical = (RadicalEntity)iter.next();
        sqlSaveRadical (conn, iterRadical);
      }

      System.out.println ("Export complete");
    }
View Full Code Here

      Statement statement = conn.createStatement();

      // radicals
      ResultSet rs = statement.executeQuery ("SELECT * FROM radicals");
      while (rs.next()) {
        RadicalEntity radical = new RadicalEntity (
            rs.getInt ("radical_number")
        );
        allRadicals.put (new Integer (radical.radicalNumber), radical);     
      }


      // radical_variants
      rs = statement.executeQuery ("SELECT * FROM radical_variants");
      while (rs.next()) {
        int radicalNumber = rs.getInt ("radical_number");
        RadicalEntity radical = (RadicalEntity)allRadicals.get (new Integer (radicalNumber));
        radical.variants.set (
            new Integer (rs.getInt ("radical_variant")),
            new Variant (
                rs.getString ("position"),
                rs.getInt ("stroke_count"),
                rs.getInt ("element_id")
            )
        );
      }

      // radical_variant_names
      rs = statement.executeQuery ("SELECT * FROM radical_variant_names");
      while (rs.next()) {
        int radicalNumber = rs.getInt ("radical_number");
        RadicalEntity radical = (RadicalEntity)allRadicals.get (new Integer (radicalNumber));
        Variant variant = radical.variants.get (new Integer (rs.getInt ("radical_variant")));
        variant.names.set (
            rs.getString("source_language_code"),
            new Variant.Name (
                rs.getString("source_name")
            )
        );
      }

      // radical_variant_mnemonics
      rs = statement.executeQuery ("SELECT * FROM radical_variant_mnemonics");
      while (rs.next()) {
        int radicalNumber = rs.getInt ("radical_number");
        RadicalEntity radical = (RadicalEntity)allRadicals.get (new Integer (radicalNumber));
        Variant variant = radical.variants.get (new Integer (rs.getInt ("radical_variant")));
        variant.mnemonics.set (
            rs.getString("dest_language_code"),
            new Variant.Mnemonic (
                rs.getString("dest_mnemonic")
View Full Code Here

  /*
   * Retrieve a clone of a DBSQLRadical from the local database
   */
  public RadicalEntity getRadical (Integer radicalNumber) {
   
    RadicalEntity radical = (RadicalEntity)radicals.get (radicalNumber);
   
    return (RadicalEntity)radical.clone();

  }
View Full Code Here

    Iterator iter;

    ArrayList allRadicalsList = new ArrayList();
    iter = radicals.values().iterator();
    while (iter.hasNext()) {
      RadicalEntity radical = (RadicalEntity)iter.next();
      allRadicalsList.add (radical.clone());
    }

    return allRadicalsList;

  }
View Full Code Here

    Iterator iter;
   
    iter = allRadicalsList.iterator();
    while (iter.hasNext()) {
      RadicalEntity radical = (RadicalEntity)iter.next();
      setRadical (radical);
    }

  }
View Full Code Here

TOP

Related Classes of org.takadb.editor.database.entities.RadicalEntity$Identifier

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.