Package net.viralpatel.contact.form

Examples of net.viralpatel.contact.form.Contact


    SessionFactory sf = (SessionFactory)ac.getBean("sessionFactory");
    Session s = sf.openSession();
    System.out.println(s);
    Transaction tx = s.beginTransaction();
   
    Contact c, c2, c3;
    c  = new Contact();
    //c.setId(123);
    c.setEmail("mln_sk@yahoo.com");
    c.setFirstname("LNRMLN");
    c.setLastname("MAJJIGA");
    c.setTelephone("9167072099")
    System.out.println(c);
    s.save(c);
    System.out.println("COntact :: "+c);
   
   
    c2 = new Contact();
    c2.setEmail("mln_sk@yahoo.com");
    c2.setFirstname("Kumar");
    c2.setLastname("jammala");
    c2.setTelephone("1234567899");   
    s.saveOrUpdate(c);
    System.out.println("COntact :: "+c);
   
   
    c3 = new Contact();
    c3.setEmail("mln_sk@mail.com");
    c3.setFirstname("Lakshman");
    c3.setLastname("kuruba");
    c3.setTelephone("9052413024");   
    s.saveOrUpdate(c);
View Full Code Here


    return sessionFactory.getCurrentSession().createQuery("from Contact")
        .list();
  }

  public void removeContact(Integer id) {
    Contact contact = (Contact) sessionFactory.getCurrentSession().load(
        Contact.class, id);
    if (null != contact) {
      sessionFactory.getCurrentSession().delete(contact);
    }
View Full Code Here

  private ContactService contactService;

  @RequestMapping("/index")
  public String listContacts(Map<String, Object> map) {

    map.put("contact", new Contact());
    map.put("contactList", contactService.listContact());

    return "contact";
  }
View Full Code Here

TOP

Related Classes of net.viralpatel.contact.form.Contact

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.