Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Currency


        Query query = em.createQuery(sql);
        query.setParameter("siteId", siteId);
        query.setParameter("currencyId", currencyId);
        List<?> list = query.getResultList();
        if (list.size() > 0) {
          Currency currency = (Currency) list.iterator().next();
          currencyCode = currency.getCurrencyCode();
        }

        return currencyCode;
    }
View Full Code Here


    sql = "from Currency currency where currency.site.siteId = :siteId";
    query = em.createQuery(sql);
    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    while (iterator.hasNext()) {
      Currency currency = (Currency) iterator.next();
        em.remove(currency);
    }

    sql = "from CustomAttribute customAttribute where customAttribute.site.siteId = :siteId";
    query = em.createQuery(sql);
View Full Code Here

        String sql = "from Currency where siteId = :siteId order by currencyCode";
        Query query = em.createQuery(sql);
        query.setParameter("siteId", Constants.SITE_SYSTEM);
        Iterator<?> iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          Currency master = (Currency) iterator.next();
          Currency currency = new Currency();
          PropertyUtils.copyProperties(currency, master);
          currency.setSite(site);
          currency.setCurrencyId(null);
          currency.setRecUpdateBy(userId);
          currency.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          currency.setRecCreateBy(userId);
          currency.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          em.persist(currency);
        }
  }
View Full Code Here

    siteCurrencyClass.setCurrencyLocaleCountry("");
    if (localeTokens.length > 1) {
      siteCurrencyClass.setCurrencyLocaleCountry(localeTokens[1]);
    }
   
    Currency currency = CurrencyDAO.load(site.getSiteId(), Format.getLong(form.getCurrencyId()));
    siteCurrencyClass.setCurrency(currency);
   
    if (insertMode) {
      em.persist(siteCurrencyClass);
      em.flush();
View Full Code Here

    Query query = em.createQuery(sql);
    query.setParameter("siteId", siteId);
    Iterator<?> iterator = query.getResultList().iterator();
    Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
    while (iterator.hasNext()) {
      Currency currency = (Currency) iterator.next();
      vector.add(new LabelValueBean(currency.getCurrencyCode(), currency.getCurrencyId().toString()));
    }
    LabelValueBean currencies[] = new LabelValueBean[vector.size()];
    vector.copyInto(currencies);
    form.setCurrencies(currencies);
  }
View Full Code Here

public class CurrencyDAO extends Currency {
  private static final long serialVersionUID = 711047579530965417L;
  public static Currency load(String siteId, Long currencyId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    Currency currency = (Currency) em.find(Currency.class, currencyId);
    if (!currency.getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return currency;
  }
View Full Code Here

    siteProfileClass.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    em.persist(siteProfileClass);
    site.setSiteProfileClassDefault(siteProfileClass);
   
    SiteCurrencyClass siteCurrencyClass = new SiteCurrencyClass();
    Currency currency = CurrencyDAO.loadByCurrencyCode(site.getSiteId(), "USD");
    siteCurrencyClass.setCurrency(currency);
    siteCurrencyClass.setCurrencyLocaleCountry("US");
    siteCurrencyClass.setCurrencyLocaleLanguage("en");
    siteCurrencyClass.setSite(site);
    siteCurrencyClass.setSiteCurrencyClassName("USD");
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.Currency

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.