Package de.willuhn.datasource.rmi

Examples of de.willuhn.datasource.rmi.DBIterator


   * @return unser Konto.
   * @throws RemoteException
   */
  public static de.willuhn.jameica.hbci.rmi.Konto HBCIKonto2HibiscusKonto(Konto konto, Class passportClass) throws RemoteException
  {
    DBIterator list = Settings.getDBService().createList(de.willuhn.jameica.hbci.rmi.Konto.class);
    list.addFilter("kontonummer = ?", new Object[]{konto.number});
    list.addFilter("blz = ?",         new Object[]{konto.blz});
    if (passportClass != null)
      list.addFilter("passport_class = ?", new Object[]{passportClass.getName()});

    // BUGZILLA 355
    if (konto.subnumber != null && konto.subnumber.length() > 0)
      list.addFilter("unterkonto = ?",new Object[]{konto.subnumber});
   
    // BUGZILLA 338: Wenn das Konto eine Bezeichnung hat, muss sie uebereinstimmen
    if (konto.type != null && konto.type.length() > 0)
      list.addFilter("bezeichnung = ?", new Object[]{konto.type});

    // Wir vervollstaendigen gleich noch die Kontoart, wenn wir eine haben und im Konto noch
    // keine hinterlegt ist.
    String type = StringUtils.trimToNull(konto.acctype);
    Integer accType = null;
    if (type != null)
    {
      try
      {
        accType = Integer.parseInt(type);
      }
      catch (Exception e)
      {
        Logger.error("unknown account type: " + type,e);
      }
    }

    if (list.hasNext())
    {
      // Konto gibts schon
      de.willuhn.jameica.hbci.rmi.Konto result = (de.willuhn.jameica.hbci.rmi.Konto) list.next();
      Integer current = result.getAccountType();
      if ((current == null && accType != null) || (current != null && accType != null && !current.equals(accType))) // Neu oder hat sich geaendert
      {
        try
        {
View Full Code Here


   */
  private static DTAUS HibiscusSammelTransfer2DTAUS(SammelTransfer s, int type) throws RemoteException
  {

    DTAUS dtaus = new DTAUS(HibiscusKonto2HBCIKonto(s.getKonto()),type);
    DBIterator buchungen = s.getBuchungen();
    SammelTransferBuchung b = null;
    while (buchungen.hasNext())
    {
      b = (SammelTransferBuchung) buchungen.next();
      final DTAUS.Transaction tr = dtaus.new Transaction();
     
      Konto other = new Konto("DE",b.getGegenkontoBLZ(),b.getGegenkontoNummer());
      other.name = b.getGegenkontoName();

View Full Code Here

  /**
   * @see de.willuhn.jameica.hbci.rmi.SepaSammelTransfer#getBuchungen()
   */
  public List<SepaSammelUeberweisungBuchung> getBuchungen() throws RemoteException
  {
    DBIterator list = this.getService().createList(SepaSammelUeberweisungBuchung.class);
    list.addFilter("sepasueb_id = " + this.getID());
    list.setOrder("order by empfaenger_name,id");
    return PseudoIterator.asList(list);
  }
View Full Code Here

      cache.type = type;
     
      if (init)
      {
        // Daten in den Cache laden
        DBIterator list = factory.load();
        while (list.hasNext())
        {
          DBObject o = (DBObject) list.next();
          cache.data.put(o.getID(),o);
          cache.values.add(o);
        }
      }
      caches.put(type,cache);
View Full Code Here

      throw new RemoteException("no parameter prefix given");

    if (prefix.indexOf("%") != -1 || prefix.indexOf("_") != -1)
      throw new RemoteException("no wildcards allowed in parameter prefix");
   
    DBIterator i = Settings.getDBService().createList(DBProperty.class);
    i.addFilter("name like ?",prefix + "%");
    try
    {
      while (i.hasNext())
      {
        DBProperty p = (DBProperty) i.next();
        p.delete();
      }
    }
    catch (ApplicationException ae)
    {
View Full Code Here

    if (name == null)
      return null;
   
    // Mal schauen, ob wir das Property schon haben
    DBService service = Settings.getDBService();
    DBIterator i = service.createList(DBProperty.class);
    i.addFilter("name = ?",name);
    if (i.hasNext())
      return (DBProperty) i.next();

    // Ne, dann neu anlegen
    DBProperty prop = (DBProperty) service.createObject(DBProperty.class,null);
    prop.setName(name);
    return prop;
View Full Code Here

    /////////////////////////////////////////////////////////////////
    // Liste der existierenden Konten mit DDV ermitteln
    // Davon ziehen wir die bereits verlinkten ab
    List<Konto> konten = new ArrayList<Konto>();
    DBIterator list = de.willuhn.jameica.hbci.Settings.getDBService().createList(Konto.class);
    list.addFilter("passport_class = ?",PassportImpl.class.getName());
    list.setOrder("ORDER BY blz, bezeichnung");
    while (list.hasNext())
    {
      Konto k = (Konto) list.next();
      if (exclude.contains(k) != null)
        continue; // Ist schon mit einer anderen DDV-Config verlinkt
      konten.add(k);
    }
    /////////////////////////////////////////////////////////////////
View Full Code Here

   * @throws RemoteException
   */
  private List<FormattedType> init(int typ) throws RemoteException
  {
    List<FormattedType> l = new LinkedList<FormattedType>();
    DBIterator list = UmsatzTypUtil.getRootElements();
    while (list.hasNext())
    {
      add((UmsatzTyp)list.next(),l,typ);
    }
    return l;
  }
View Full Code Here

          String zweck = (String) getZweck().getValue();
          String zweck2 = (String) getZweck2().getText();
          if ((zweck != null && zweck.length() > 0) || (zweck2 != null && zweck2.length() > 0))
            return;
         
          DBIterator list = getBuchung().getList();
          list.addFilter("gegenkonto_nr = ?",new Object[]{gegenKonto.getKontonummer()});
          list.addFilter("gegenkonto_blz = ?"new Object[]{gegenKonto.getBlz()});
          list.setOrder("order by id desc");
          if (list.hasNext())
          {
            SammelTransferBuchung t = (SammelTransferBuchung) list.next();
            getZweck().setValue(t.getZweck());
            getZweck2().setText(t.getZweck2());
          }
        }
        catch (Exception e)
View Full Code Here

  private void load() throws RemoteException
  {
    this.data.clear();
    calculateRange();

    DBIterator umsaetze = UmsatzUtil.getUmsaetze();
    Object o = getKontoAuswahl().getValue();
    if (o != null && (o instanceof Konto))
      umsaetze.addFilter("konto_id = " + ((Konto) o).getID());
    else if (o != null && (o instanceof String))
      umsaetze.addFilter("konto_id in (select id from konto where kategorie = ?)", (String) o);

    if (start != null)
      umsaetze.addFilter("datum >= ?", new Object[] {new java.sql.Date(start.getTime())});

    UmsatzEntry currentEntry = null;
    Calendar cal             = Calendar.getInstance();
    Date currentLimit        = null;

    while (umsaetze.hasNext())
    {
      Umsatz u = (Umsatz) umsaetze.next();
      Date date = u.getDatum();
      if (date == null)
      {
        Logger.warn("no date found for umsatz, skipping record");
        continue;
View Full Code Here

TOP

Related Classes of de.willuhn.datasource.rmi.DBIterator

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.