Examples of Account


Examples of org.hibernate.test.domain.Account

        person.setAge(40);
        person.setFirstname("Bae");
        person.setLastname("Sunghyouk");
        session.save(person);

        Account account = new Account();
        account.setPerson(person);
        session.save(account);

        session.flush();
        session.close();

        session = sessionFactory.openSession();
        Account acc = (Account) session.get(Account.class, account.getId());
        assertThat(acc).isNotNull();
        assertThat(acc.getPerson()).isNotNull();
        session.close();

        log.info("Account:[{}]", slcs.toString());
        assertThat(slcs.getPutCount()).isEqualTo(1);
        assertThat(slcs.getElementCountInMemory()).isEqualTo(1);

        log.info("Person:[{}]", slcs2.toString());
        assertThat(slcs2.getPutCount()).isEqualTo(1);
        assertThat(slcs2.getElementCountInMemory()).isEqualTo(1);

        session = sessionFactory.openSession();
        acc = (Account) session.get(Account.class, account.getId());
        assertThat(acc).isNotNull();
        assertThat(acc.getPerson()).isNotNull();
        session.close();

        log.info("Account:[{}]", slcs.toString());
        assertThat(slcs.getPutCount()).isEqualTo(1);
        assertThat(slcs.getElementCountInMemory()).isEqualTo(1);
View Full Code Here

Examples of org.hibernate.validator.test.internal.engine.valuehandling.model.Account

    assertEquals( violations.size(), 3 );
  }

  @Test
  public void shouldUnwrapPropertyValuesDuringCascadedValidation() {
    Set<ConstraintViolation<Account>> violations = validator.validate( new Account() );
    assertEquals( violations.size(), 3 );
  }
View Full Code Here

Examples of org.infinispan.client.hotrod.protostream.domain.Account

   @Override
   public Account readFrom(ProtobufReader reader) throws IOException {
      int id = reader.readInt("id");
      String description = reader.readString("description");

      Account account = new Account();
      account.setId(id);
      account.setDescription(description);
      return account;
   }
View Full Code Here

Examples of org.infinispan.protostream.domain.Account

      String description = reader.readString("description");
      long creationDate = reader.readLong("creationDate");
      Account.Limits limits = reader.readObject("limits", Account.Limits.class);
      List<byte[]> blurb = reader.readCollection("blurb", new ArrayList<byte[]>(), byte[].class);

      Account account = new Account();
      account.setId(id);
      account.setDescription(description);
      account.setCreationDate(new Date(creationDate));
      account.setLimits(limits);
      account.setBlurb(blurb);
      return account;
   }
View Full Code Here

Examples of org.infinispan.protostream.sampledomain.Account

      user3.setName("Spider");
      user3.setSurname("Woman");
      user3.setGender(User.Gender.FEMALE);
      user3.setAccountIds(Collections.<Integer>emptyList());

      Account account1 = new Account();
      account1.setId(1);
      account1.setDescription("John Doe's first bank account");
      account1.setCreationDate(DATE_FORMAT.parse("2013-01-03"));

      Account account2 = new Account();
      account2.setId(2);
      account2.setDescription("John Doe's second bank account");
      account2.setCreationDate(DATE_FORMAT.parse("2013-01-04"));

      Account account3 = new Account();
      account3.setId(3);
      account3.setCreationDate(DATE_FORMAT.parse("2013-01-20"));

      Transaction transaction0 = new Transaction();
      transaction0.setId(0);
      transaction0.setDescription("Birthday present");
      transaction0.setAccountId(1);
      transaction0.setAmount(1800);
      transaction0.setDate(DATE_FORMAT.parse("2012-09-07"));
      transaction0.setDebit(false);

      Transaction transaction1 = new Transaction();
      transaction1.setId(1);
      transaction1.setDescription("Feb. rent payment");
      transaction1.setAccountId(1);
      transaction1.setAmount(1500);
      transaction1.setDate(DATE_FORMAT.parse("2013-01-05"));
      transaction1.setDebit(true);

      Transaction transaction2 = new Transaction();
      transaction2.setId(2);
      transaction2.setDescription("Starbucks");
      transaction2.setAccountId(1);
      transaction2.setAmount(23);
      transaction2.setDate(DATE_FORMAT.parse("2013-01-09"));
      transaction2.setDebit(true);

      Transaction transaction3 = new Transaction();
      transaction3.setId(3);
      transaction3.setDescription("Hotel");
      transaction3.setAccountId(2);
      transaction3.setAmount(45);
      transaction3.setDate(DATE_FORMAT.parse("2013-02-27"));
      transaction3.setDebit(true);

      Transaction transaction4 = new Transaction();
      transaction4.setId(4);
      transaction4.setDescription("Last january");
      transaction4.setAccountId(2);
      transaction4.setAmount(95);
      transaction4.setDate(DATE_FORMAT.parse("2013-01-31"));
      transaction4.setDebit(true);

      Transaction transaction5 = new Transaction();
      transaction5.setId(5);
      transaction5.setDescription("Popcorn");
      transaction5.setAccountId(2);
      transaction5.setAmount(5);
      transaction5.setDate(DATE_FORMAT.parse("2013-01-01"));
      transaction5.setDebit(true);

      // persist and index the test objects
      // we put all of them in the same cache for the sake of simplicity
      remoteCache.put("user_" + user1.getId(), user1);
      remoteCache.put("user_" + user2.getId(), user2);
      remoteCache.put("user_" + user3.getId(), user3);
      remoteCache.put("account_" + account1.getId(), account1);
      remoteCache.put("account_" + account2.getId(), account2);
      remoteCache.put("account_" + account3.getId(), account3);
      remoteCache.put("transaction_" + transaction0.getId(), transaction0);
      remoteCache.put("transaction_" + transaction1.getId(), transaction1);
      remoteCache.put("transaction_" + transaction2.getId(), transaction2);
      remoteCache.put("transaction_" + transaction3.getId(), transaction3);
      remoteCache.put("transaction_" + transaction4.getId(), transaction4);
View Full Code Here

Examples of org.infinispan.query.dsl.embedded.sample_domain_model.Account

      user3.setName("Spider");
      user3.setSurname("Woman");
      user3.setGender(User.Gender.FEMALE);
      user3.setAccountIds(Collections.<Integer>emptySet());

      Account account1 = new Account();
      account1.setId(1);
      account1.setDescription("John Doe's first bank account");
      account1.setCreationDate(DATE_FORMAT.parse("2013-01-03"));

      Account account2 = new Account();
      account2.setId(2);
      account2.setDescription("John Doe's second bank account");
      account2.setCreationDate(DATE_FORMAT.parse("2013-01-04"));

      Account account3 = new Account();
      account3.setId(3);
      account3.setCreationDate(DATE_FORMAT.parse("2013-01-20"));

      Transaction transaction0 = new Transaction();
      transaction0.setId(0);
      transaction0.setDescription("Birthday present");
      transaction0.setAccountId(1);
      transaction0.setAmount(1800);
      transaction0.setDate(DATE_FORMAT.parse("2012-09-07"));
      transaction0.setDebit(false);

      Transaction transaction1 = new Transaction();
      transaction1.setId(1);
      transaction1.setDescription("Feb. rent payment");
      transaction1.setAccountId(1);
      transaction1.setAmount(1500);
      transaction1.setDate(DATE_FORMAT.parse("2013-01-05"));
      transaction1.setDebit(true);

      Transaction transaction2 = new Transaction();
      transaction2.setId(2);
      transaction2.setDescription("Starbucks");
      transaction2.setAccountId(1);
      transaction2.setAmount(23);
      transaction2.setDate(DATE_FORMAT.parse("2013-01-09"));
      transaction2.setDebit(true);

      Transaction transaction3 = new Transaction();
      transaction3.setId(3);
      transaction3.setDescription("Hotel");
      transaction3.setAccountId(2);
      transaction3.setAmount(45);
      transaction3.setDate(DATE_FORMAT.parse("2013-02-27"));
      transaction3.setDebit(true);

      Transaction transaction4 = new Transaction();
      transaction4.setId(4);
      transaction4.setDescription("Last january");
      transaction4.setAccountId(2);
      transaction4.setAmount(95);
      transaction4.setDate(DATE_FORMAT.parse("2013-01-31"));
      transaction4.setDebit(true);

      Transaction transaction5 = new Transaction();
      transaction5.setId(5);
      transaction5.setDescription("Popcorn");
      transaction5.setAccountId(2);
      transaction5.setAmount(5);
      transaction5.setDate(DATE_FORMAT.parse("2013-01-01"));
      transaction5.setDebit(true);

      // persist and index the test objects
      // we put all of them in the same cache for the sake of simplicity
      cache1.put("user_" + user1.getId(), user1);
      cache1.put("user_" + user2.getId(), user2);
      cache1.put("user_" + user3.getId(), user3);
      cache1.put("account_" + account1.getId(), account1);
      cache1.put("account_" + account2.getId(), account2);
      cache1.put("account_" + account3.getId(), account3);
      cache1.put("transaction_" + transaction0.getId(), transaction0);
      cache1.put("transaction_" + transaction1.getId(), transaction1);
      cache1.put("transaction_" + transaction2.getId(), transaction2);
      cache1.put("transaction_" + transaction3.getId(), transaction3);
      cache1.put("transaction_" + transaction4.getId(), transaction4);
View Full Code Here

Examples of org.infinispan.query.dsl.embedded.testdomain.Account

      user3.setName("Spider");
      user3.setSurname("Woman");
      user3.setGender(User.Gender.FEMALE);
      user3.setAccountIds(Collections.<Integer>emptySet());

      Account account1 = getModelFactory().makeAccount();
      account1.setId(1);
      account1.setDescription("John Doe's first bank account");
      account1.setCreationDate(makeDate("2013-01-03"));

      Account account2 = getModelFactory().makeAccount();
      account2.setId(2);
      account2.setDescription("John Doe's second bank account");
      account2.setCreationDate(makeDate("2013-01-04"));

      Account account3 = getModelFactory().makeAccount();
      account3.setId(3);
      account3.setCreationDate(makeDate("2013-01-20"));

      Transaction transaction0 = getModelFactory().makeTransaction();
      transaction0.setId(0);
      transaction0.setDescription("Birthday present");
      transaction0.setAccountId(1);
      transaction0.setAmount(1800);
      transaction0.setDate(makeDate("2012-09-07"));
      transaction0.setDebit(false);

      Transaction transaction1 = getModelFactory().makeTransaction();
      transaction1.setId(1);
      transaction1.setDescription("Feb. rent payment");
      transaction1.setAccountId(1);
      transaction1.setAmount(1500);
      transaction1.setDate(makeDate("2013-01-05"));
      transaction1.setDebit(true);

      Transaction transaction2 = getModelFactory().makeTransaction();
      transaction2.setId(2);
      transaction2.setDescription("Starbucks");
      transaction2.setAccountId(1);
      transaction2.setAmount(23);
      transaction2.setDate(makeDate("2013-01-09"));
      transaction2.setDebit(true);

      Transaction transaction3 = getModelFactory().makeTransaction();
      transaction3.setId(3);
      transaction3.setDescription("Hotel");
      transaction3.setAccountId(2);
      transaction3.setAmount(45);
      transaction3.setDate(makeDate("2013-02-27"));
      transaction3.setDebit(true);

      Transaction transaction4 = getModelFactory().makeTransaction();
      transaction4.setId(4);
      transaction4.setDescription("Last january");
      transaction4.setAccountId(2);
      transaction4.setAmount(95);
      transaction4.setDate(makeDate("2013-01-31"));
      transaction4.setDebit(true);

      Transaction transaction5 = getModelFactory().makeTransaction();
      transaction5.setId(5);
      transaction5.setDescription("Popcorn");
      transaction5.setAccountId(2);
      transaction5.setAmount(5);
      transaction5.setDate(makeDate("2013-01-01"));
      transaction5.setDebit(true);

      // persist and index the test objects
      // we put all of them in the same cache for the sake of simplicity
      getCacheForWrite().put("user_" + user1.getId(), user1);
      getCacheForWrite().put("user_" + user2.getId(), user2);
      getCacheForWrite().put("user_" + user3.getId(), user3);
      getCacheForWrite().put("account_" + account1.getId(), account1);
      getCacheForWrite().put("account_" + account2.getId(), account2);
      getCacheForWrite().put("account_" + account3.getId(), account3);
      getCacheForWrite().put("transaction_" + transaction0.getId(), transaction0);
      getCacheForWrite().put("transaction_" + transaction1.getId(), transaction1);
      getCacheForWrite().put("transaction_" + transaction2.getId(), transaction2);
      getCacheForWrite().put("transaction_" + transaction3.getId(), transaction3);
      getCacheForWrite().put("transaction_" + transaction4.getId(), transaction4);
View Full Code Here

Examples of org.internna.ossmoney.model.Account

    }

    @RequestMapping("/{id}")
    public String investments(@PathVariable Long id, ModelMap modelMap) {
      modelMap.addAttribute("id", id);
      Account account = Account.findAccount(id);
      UserDetails user = UserDetails.findCurrentUser();
      if (account.belongsTo(user)) {
        modelMap.addAttribute("investments", account.getCurrentInvestments());
      }
      return "investment/performance";
    }
View Full Code Here

Examples of org.java.demo.model.Account

  @Resource
  private AccountService accountService;

  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    Account account = accountService.getByLoginName(username);
    UserDetails userDetails = new UserDetailsImpl(account);
    return userDetails;   
  }
View Full Code Here

Examples of org.javalite.activejdbc.test_models.Account

    }

    @Test
    public void shouldAcceptCorrectValueForTotal(){
        deleteAndPopulateTable("accounts");
        Account account = new Account();
        account.set("amount", 1);
        account.set("total", 1);
        System.out.println(account.errors());
        a(account).shouldBe("valid");
    }
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.