Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.GuestBook


@Repository
public class GuestBookDAOImpl extends BasisDAO<GuestBook> implements GuestBookDAO {

  @Override
  public GuestBook getNewGuestBook() {
    return new GuestBook();
  }
View Full Code Here


  // ############################## Tests ##################################

  @Test
  @Transactional
  public void getNewGuestBook() {
    GuestBook obj = getGuestBookDAO().getNewGuestBook();
    Assert.assertEquals("Not the expected result", Long.MIN_VALUE+1, obj.getId());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void saveOrUpdateGuestbook() {
    GuestBook entity = getGuestBookDAO().getNewGuestBook();
    entity.setGubSubject("TEST-ENTRY");
    entity.setGubDate(new Date());
    entity.setGubUsrname("testuser");

    getGuestBookDAO().saveOrUpdate(entity);

    GuestBook obj2 = getGuestBookDAO().getGuestBookByID(entity.getId());
    Assert.assertEquals("Not the expected result", "TEST-ENTRY", obj2.getGubSubject());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void saveGuestbook() {
    GuestBook entity = getGuestBookDAO().getNewGuestBook();
    entity.setGubSubject("TEST-ENTRY");
    entity.setGubDate(new Date());
    entity.setGubUsrname("testuser");

    getGuestBookDAO().save(entity);

    GuestBook obj2 = getGuestBookDAO().getGuestBookByID(entity.getId());
    Assert.assertEquals("Not the expected result", "TEST-ENTRY", obj2.getGubSubject());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void deleteGuestBook() {
    GuestBook entity = getGuestBookDAO().getNewGuestBook();
    entity.setGubSubject("TEST-ENTRY");
    entity.setGubDate(new Date());
    entity.setGubUsrname("testuser");

    getGuestBookDAO().saveOrUpdate(entity);

    GuestBook obj2 = getGuestBookDAO().getGuestBookByID(entity.getId());
    Assert.assertEquals("Not the expected result", "TEST-ENTRY", obj2.getGubSubject());

    getGuestBookDAO().delete(entity);
  }
View Full Code Here

    // get the params map that are overhanded by creation.
    Map<String, Object> args = getCreationArgsMap(event);

    if (args.containsKey("guestBook")) {
      GuestBook guestBook = (GuestBook) args.get("guestBook");
      setGuestBook(guestBook);
    } else {
      setGuestBook(null);
    }
View Full Code Here

   *
   * @throws InterruptedException
   */
  private void doDelete() throws InterruptedException {

    final GuestBook guestBook = getGuestBook();

    // Show a confirm box
    String msg = Labels.getLabel("message.Question.Are_you_sure_to_delete_this_record") + "\n\n --> " + guestBook.getGubDate() + "/" + guestBook.getGubSubject();
    String title = Labels.getLabel("message.Deleting.Record");

    MultiLineMessageBox.doSetTemplate();
    if (MultiLineMessageBox.show(msg, title, MultiLineMessageBox.YES | MultiLineMessageBox.NO, Messagebox.QUESTION, new EventListener() {
      @Override
View Full Code Here

  private void doNew() {

    /** !!! DO NOT BREAK THE TIERS !!! */
    // We don't create a new DomainObject() in the frontend.
    // We GET it from the backend.
    GuestBook aGuestBook = getguestBookService().getNewGuestBook();

    // init with actual date
    aGuestBook.setGubDate(new Date());

    setGuestBook(aGuestBook);

    doClear(); // clear all commponents
    doEdit(); // edit mode
View Full Code Here

   */
  @Secured( { btnCtroller_ClassPrefix + "btnSave" })
  public void doSave() throws InterruptedException {
    System.out.println("doSave");

    GuestBook aGuestBook = getGuestBook();

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // force validation, if on, than execute by component.getValue()
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if (!isValidationOn()) {
View Full Code Here

      int rowIndex = 0;
      // only for correct showing after Rendering. No effect as an Event
      // yet.
      listbox_GuestBookList.setSelectedIndex(rowIndex);
      // get the first entry and cast them to the needed object
      GuestBook aGuestBook = (GuestBook) lml.get(rowIndex);
      if (aGuestBook != null) {
        textbox_GuestBook_gubText.setValue(aGuestBook.getGubText());
      }
    }

  }
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.model.GuestBook

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.