Examples of Purchaser


Examples of org.bigk.invoices.model.Purchaser

    return super.edit();
  }

  @Override
  public void prepareSave() throws ServiceException {
    model = new Purchaser();
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

    return REDIRECT_LIST;
  }
 
  public void prepareBackToList() throws ServiceException {
    logger.debug("prepareBackToList() - start");
    this.model = new Purchaser();
    logger.debug("prepareBackToList() - end");
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

  @Override
  public Purchaser getPurchaser(Long id) throws ServiceException {
    logger.debug("getPurchaser(id=[{}]) - start", + id);

    Purchaser purchaser = em.find(Purchaser.class, id);

    logger.debug("getPurchaser(Long) - end - return value=[{}]", purchaser);
    return purchaser;
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

@RunWith(JUnit4.class)
public class PurchaserTest {

  @Test
  public void neitherOfPurchaserEqualsNull() throws Exception {
    Purchaser aPurchaser = new Purchaser();
    assertFalse(aPurchaser.equals(null));
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

    assertFalse(aPurchaser.equals(null));
  }
 
  @Test
  public void twoPurchasersEqualByReference() throws Exception {
    Purchaser aPurchaser = new Purchaser();
    assertTrue(aPurchaser.equals(aPurchaser));
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

  }
 
  @Test
  public void twoPurchasersEqualWhenAllTheirFieldsEqual() throws Exception {
   
    Purchaser purchaserJohn = aPurchaser().withId(1L).withName("John")
        .withAddress("blah-blah 11").withNip("111-22-33-4444").build();
    Purchaser purchaserJohnAgain = aPurchaser().withId(1L).withName("John")
        .withAddress("blah-blah 11").withNip("111-22-33-4444").build();
   
    assertEquals(purchaserJohn, purchaserJohnAgain);
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

  }

  @Test
  public void purchaserEqualsHisSubclassWhenAllTheirFieldsEqual() throws Exception {
   
    Purchaser purchaserJohn = aPurchaser().withId(1L).withName("John")
        .withAddress("blah-blah 11").withNip("111-22-33-4444").build();
    Purchaser purchaserJohnSubclassed = new Purchaser() {
      // this is subclass of Purchaser.class
      private static final long serialVersionUID = 1L;
    };
    purchaserJohnSubclassed.setId(purchaserJohn.getId());
    purchaserJohnSubclassed.setName(purchaserJohn.getName());
    purchaserJohnSubclassed.setAddress(purchaserJohn.getAddress());
    purchaserJohnSubclassed.setNip(purchaserJohn.getNip());
       
    assertEquals(purchaserJohn, purchaserJohnSubclassed);
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

    this.nip = nip;
    return this;
  }

  public Purchaser build() {
    Purchaser purchaser = new Purchaser();
    purchaser.setId(this.id);
    purchaser.setName(this.name);
    purchaser.setAddress(this.address);
    purchaser.setNip(this.nip);
    return purchaser;
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

   
    // given
    Long nonExistingPurchasersId = maxExistingPurchasersId() + 1;
   
    // when
    Purchaser purchaser = service.getPurchaser(nonExistingPurchasersId);
   
    // then
    assertNull(purchaser);
  }
View Full Code Here

Examples of org.bigk.invoices.model.Purchaser

    return em.createQuery("SELECT p FROM Purchaser p ORDER BY p.id DESC", Purchaser.class)
        .setMaxResults(1).getSingleResult();
  }
 
  private Long maxExistingPurchasersId() {
    Purchaser purchaserWithMaxId = purchaserWithMaxId();
    if (purchaserWithMaxId != null) {
      return purchaserWithMaxId.getId();
    }
    return 0L;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.