Package au.com.cahaya.asas.ds.party.model

Examples of au.com.cahaya.asas.ds.party.model.ContactModel


   
    if (checkContactExist (em, party, newContact)) {
      myLog.info ("edit - contact {} for party {} already exists.", newContact, party);
    }
    else {
      ContactModel con = findCreateContact (em, newContact);
      if (oldContact != null) {
        makeOldContactInactive(em, party, oldContact);
      }

      Query partyUsageTypeQuery = em.createNamedQuery ("putByCode");
View Full Code Here


   */
  private ContactModel findCreateContact (EntityManager em, String newContact)
  {
    Query contactQuery = em.createNamedQuery ("conByContact");
    contactQuery.setParameter ("contact", newContact);
    ContactModel con = null;
    try {
      con = (ContactModel)(contactQuery.getSingleResult ());
      myLog.debug ("edit - retrieved {}", con);
    }
    catch (NoResultException exc) {
      myLog.debug ("edit - existing contact {} not found.", newContact);
      con = null;
    }
    if (con == null) {
      Query contactTypeQuery = em.createNamedQuery ("cotByCode");
      contactTypeQuery.setParameter ("code", ContactType.eEmail.getCode ());
      ContactTypeModel cot = (ContactTypeModel)(contactTypeQuery.getSingleResult ());
      myLog.debug ("edit - retrieved contact type {}, {}", cot.getKey (), cot);
     
      con = new ContactModel (cot, newContact, "cahaya");
      {
        Object [] t = {con, con.getType ().getKey (), con.getType ()};
        myLog.debug ("edit - retrieved contact {}, {}, {}", t);
      }
     
      em.persist (con);
    }
View Full Code Here

TOP

Related Classes of au.com.cahaya.asas.ds.party.model.ContactModel

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.