Package org.jrest4guice.sample.contact.entity

Examples of org.jrest4guice.sample.contact.entity.Contact


   */
  @Get
  @PageFlow(success = @PageInfo(value = "/template/contactDetail.ctl"))
  public Contact getContact(@Cache @Parameter("contactId") String contactId) {
    if(contactId == null)
      return new Contact();
    return this.service.findContactById(contactId);
  }
View Full Code Here


  }

  @RolesAllowed("admin")
  public void deleteContact(String contactId) {
    String[] ids = contactId.split(",");
    Contact contact;
    for (String id : ids) {
      contact = this.findContactById(id);
      if (contact == null)
        throw new RuntimeException("联系人不存在");
      this.entityManager.delete(contact);
View Full Code Here

  public void updateContact(Contact contact) {
    if (contact == null)
      throw new RuntimeException("联系人的内容不能为空");
   
    Contact tmpContact = this.entityManager.load("named:byName", contact.getName());
    if(tmpContact != null && !contact.getId().equals(tmpContact.getId()))
      throw new RuntimeException("联系人的姓名相同,请重新输入");

    this.entityManager.update(contact);
  }
View Full Code Here

TOP

Related Classes of org.jrest4guice.sample.contact.entity.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.