Package com.tll.common.model

Examples of com.tll.common.model.StringPropertyValue


  @Test
  public void testAdd() throws Exception {
    final PersistServiceDelegate delegate = getDelegate();

    Model m = new Model(TestEntityType.ADDRESS);
    m.set(new StringPropertyValue(Model.ID_PROPERTY, "10000"));
    m.set(new StringPropertyValue("address1", "1 tee streetU"));
    m.set(new StringPropertyValue("address2", "2 bee"));
    m.set(new StringPropertyValue("city", "the city"));
    m.set(new StringPropertyValue("country", "us"));
    m.set(new StringPropertyValue("emailAddress", "email@schmemail.com"));
    m.set(new StringPropertyValue("fax", "2223334444"));
    m.set(new StringPropertyValue("firstName", "First"));
    m.set(new StringPropertyValue("lastName", "Last"));
    m.set(new CharacterPropertyValue("mi", 'm'));
    m.set(new StringPropertyValue("phone", "1112223333"));
    m.set(new StringPropertyValue("postalCode", "48104"));
    m.set(new StringPropertyValue("province", "MI"));

    final ModelPayload p = delegate.persist(new PersistRequest(m, false));
    assert p != null;
    m = p.getModel();
    assert m != null;
View Full Code Here


    final PersistServiceDelegate delegate = getDelegate();

    Model m = new Model(TestEntityType.ADDRESS);
    m.set(new IntPropertyValue(Model.VERSION_PROPERTY, 0));
    m.set(new StringPropertyValue(Model.ID_PROPERTY, id));
    m.set(new StringPropertyValue("address1", "1 changed street"));
    m.set(new StringPropertyValue("address2", "2 beechange"));
    m.set(new StringPropertyValue("city", "change city"));

    final ModelPayload p = delegate.persist(new PersistRequest(m, true));
    assert p != null;
    m = p.getModel();
    assert m != null;
View Full Code Here

    if(a.getParent() != null) {
      final PrimaryKey<Account> pk = new PrimaryKey<Account>(Account.class, a.getParent().getId());
      final IAccountService svc = context.getEntityServiceFactory().instance(IAccountService.class);
      final Account parent = svc.load(pk);
      final Model mparent = new Model(TestEntityType.ACCOUNT);
      mparent.set(new StringPropertyValue(Model.ID_PROPERTY, parent.getId()));
      mparent.set(new StringPropertyValue(Model.NAME_PROPERTY, parent.getName()));
      m.set(new RelatedOneProperty(TestEntityType.ACCOUNT, mparent, "parent", true));
    }
    return m;
  }
View Full Code Here

   *        standard entity name property will be added.
   * @return the stubbed model
   */
  public static Model stubModel(TestEntityType type, Integer version, boolean timestamping, String name) {
    final Model m = new Model(type);
    m.set(new StringPropertyValue(Model.ID_PROPERTY, new PropertyMetadata(PropertyType.STRING, false, true, 10),
        Integer.toString(++nextUniqueId)));
    m.set(new IntPropertyValue(Model.VERSION_PROPERTY, version));
    if(name != null) {
      m.set(new StringPropertyValue(Model.NAME_PROPERTY, new PropertyMetadata(PropertyType.STRING, false, true, 32),
          name));
    }
    m.set(new DatePropertyValue(Model.DATE_CREATED_PROPERTY, new PropertyMetadata(PropertyType.DATE, true, true, 32),
        new Date()));
    m.set(new DatePropertyValue(Model.DATE_MODIFIED_PROPERTY, new PropertyMetadata(PropertyType.DATE, true, true, 32),
View Full Code Here

    m
    .set(new EnumPropertyValue("status", new PropertyMetadata(PropertyType.ENUM, false, true, 16),
        AccountStatus.OPEN));
    m.set(new BooleanPropertyValue("persistPymntInfo", new PropertyMetadata(PropertyType.BOOL, false, true, -1),
        Boolean.TRUE));
    m.set(new StringPropertyValue("billingModel", new PropertyMetadata(PropertyType.STRING, false, true, 32),
    "a billing model"));
    m.set(new StringPropertyValue("billingCycle", new PropertyMetadata(PropertyType.STRING, false, true, 32),
    "a billing cycle"));
    m
    .set(new DatePropertyValue("dateLastCharged", new PropertyMetadata(PropertyType.DATE, false, true, 32),
        new Date()));
    m
View Full Code Here

   * @param num
   * @return new instance
   */
  public static Model stubAddress(int num) {
    final Model address = stubModel(TestEntityType.ADDRESS, null, false, null);
    address.set(new StringPropertyValue("emailAddress", new PropertyMetadata(PropertyType.STRING, false, false, 32),
        "email" + num + "@domain.com"));
    address.set(new StringPropertyValue("firstName", new PropertyMetadata(PropertyType.STRING, false, false, 32),
        "firstname " + num));
    address.set(new StringPropertyValue("lastName", new PropertyMetadata(PropertyType.STRING, false, true, 32),
        "lastname " + num));
    address.set(new CharacterPropertyValue("mi", new PropertyMetadata(PropertyType.CHAR, false, false, 1), 'm'));
    address.set(new StringPropertyValue("address1", new PropertyMetadata(PropertyType.STRING, false, true, 32),
        "address1 " + num));
    address.set(new StringPropertyValue("address2", new PropertyMetadata(PropertyType.STRING, false, false, 32),
        "address2 " + num));
    address.set(new StringPropertyValue("city", new PropertyMetadata(PropertyType.STRING, false, true, 32), "city "
        + num));
    address.set(new StringPropertyValue("province", new PropertyMetadata(PropertyType.STRING, false, true, 32),
        "province " + num));
    address.set(new StringPropertyValue("postalCode", new PropertyMetadata(PropertyType.STRING, false, true, 32),
        "zip " + num));
    address.set(new StringPropertyValue("country", new PropertyMetadata(PropertyType.STRING, false, true, 32),
        "country " + num));

    // test boolean prop types..
    address.set(new BooleanPropertyValue("boolean", new PropertyMetadata(PropertyType.BOOL, false, true, -1),
        Boolean.TRUE));
View Full Code Here

   * Stubs a currency model
   * @return new instance
   */
  public static Model stubCurrency() {
    final Model m = stubModel(TestEntityType.CURRENCY, null, false, null);
    m.set(new StringPropertyValue("iso4217", new PropertyMetadata(PropertyType.STRING, false, true, 8), "usd"));
    m.set(new StringPropertyValue("symbol", new PropertyMetadata(PropertyType.STRING, false, true, 8), "$"));
    m.set(new DoublePropertyValue("usdExchangeRage", new PropertyMetadata(PropertyType.DOUBLE, false, true, -1), 1d));
    return m;
  }
View Full Code Here

   * Stubs payment info
   * @return new Model representing payment info
   */
  public static Model stubPaymentInfo() {
    final Model m = stubModel(TestEntityType.PAYMENT_INFO, null, false, null);
    m.set(new StringPropertyValue("paymentData_bankAccountNo", new PropertyMetadata(PropertyType.STRING, false, false,
        16), "0005543"));
    m.set(new StringPropertyValue("paymentData_bankName", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "bank name"));
    m.set(new StringPropertyValue("paymentData_bankRoutingNo", new PropertyMetadata(PropertyType.STRING, false, false,
        16), "77777"));
    m.set(new EnumPropertyValue("paymentData_ccType", new PropertyMetadata(PropertyType.ENUM, false, false, 16),
        CreditCardType.VISA));
    m.set(new StringPropertyValue("paymentData_ccNum", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "4111111111111111"));
    m.set(new StringPropertyValue("paymentData_ccCvv2", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "834"));
    m.set(new IntPropertyValue("paymentData_ccExpMonth", new PropertyMetadata(PropertyType.INT, false, false, 16), 8));
    m
    .set(new IntPropertyValue("paymentData_ccExpYear", new PropertyMetadata(PropertyType.INT, false, false, 16),
        2012));
    m.set(new StringPropertyValue("paymentData_ccName", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "cc name"));
    m.set(new StringPropertyValue("paymentData_ccAddress1",
        new PropertyMetadata(PropertyType.STRING, false, false, 16), "88 Broadway"));
    m.set(new StringPropertyValue("paymentData_ccAddress2",
        new PropertyMetadata(PropertyType.STRING, false, false, 16), "#32"));
    m.set(new StringPropertyValue("paymentData_ccCity", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "Sacramento"));
    m.set(new StringPropertyValue("paymentData_ccState", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "CA"));
    m.set(new StringPropertyValue("paymentData_ccZip", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "99885"));
    m.set(new StringPropertyValue("paymentData_ccCountry", new PropertyMetadata(PropertyType.STRING, false, false, 16),
    "us"));

    return m;
  }
View Full Code Here

    if(a.getParent() != null) {
      final PrimaryKey<Account> pk = new PrimaryKey<Account>(Account.class, a.getParent().getId());
      final IAccountService svc = context.getEntityServiceFactory().instance(IAccountService.class);
      final Account parent = svc.load(pk);
      final Model mparent = new Model(SmbizEntityType.ACCOUNT);
      mparent.set(new StringPropertyValue(Model.ID_PROPERTY, parent.getId()));
      mparent.set(new StringPropertyValue(Model.NAME_PROPERTY, parent.getName()));
      m.set(new RelatedOneProperty(SmbizEntityType.ACCOUNT, mparent, "parent", true));
    }
    return m;
  }
View Full Code Here

   */
  public MerchantListingWidget(ModelKey parentAccountRef) {
    super(config);
    this.parentAccountRef = parentAccountRef;
    criteria = new NamedQuerySearch(SmbizEntityType.MERCHANT, "account.merchantList", true);
    criteria.addParam(new StringPropertyValue("parentId", parentAccountRef.getId()));

    setOperator(RemoteListingOperator.create(config.getListingId(),
        ListHandlerType.PAGE, criteria, config.getModelProperties(),
        config.getPageSize(), config.getDefaultSorting()));
  }
View Full Code Here

TOP

Related Classes of com.tll.common.model.StringPropertyValue

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.