Examples of BookModel


Examples of Models.BookModel

    public panelSearchBook() {
        initComponents();
    }
   
    private void fillTable(String type , String name){
        BookModel bookModel = new BookModel();
        List<Book> books = null;
        switch (type) {
            case "whereName":
                books = bookModel.whereName(name);
                break;
            case "all":
                books = bookModel.all();
                break;
            default: ;
        }
      
       
View Full Code Here

Examples of Models.BookModel

        book.setName(bookName);
        book.setAuthor_id(author_id);
        book.setPrice(price);
        book.setTotal_pages(total_pages);
       
        BookModel bookModel = new BookModel();
        int flag = bookModel.save(book);
       
        if(flag == 1)
        {
            JOptionPane.showMessageDialog(null, "Book added !", "Message", JOptionPane.INFORMATION_MESSAGE);
            clearAllInputFields();
View Full Code Here

Examples of org.camelcookbook.transformation.csv.model.BookModel

    public void testCsvMarshal() throws Exception {
        ArrayList<BookModel> books = new ArrayList<BookModel>();

        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM-yyyy");

        BookModel book = new BookModel();
        book.setCategory("PROGRAMMING");
        book.setTitle("Camel in Action");
        book.setTitleLanguage("en");
        book.setAuthor1("Claus Ibsen");
        book.setAuthor2("Jon Anstey");
        book.setPublishDate(simpleDateFormat.parse("Dec-2010"));
        book.setPrice(BigDecimal.valueOf(49.99));

        books.add(book);

        book = new BookModel();
        book.setCategory("PROGRAMMING");
        book.setTitle("Apache Camel Developer's Cookbook");
        book.setTitleLanguage("en");
        book.setAuthor1("Scott Cranton");
        book.setAuthor2("Jakub Korab");
        book.setPublishDate(simpleDateFormat.parse("Dec-2013"));
        book.setPrice(BigDecimal.valueOf(49.99));

        books.add(book);

        final String response = template.requestBody("direct:marshal", books, String.class);
View Full Code Here

Examples of org.camelcookbook.transformation.csv.model.BookModel

    protected List<Map<String, Object>> createCsvModel() throws ParseException {
        final List<Map<String, Object>> books = new ArrayList<Map<String, Object>>();

        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM-yyyy");

        BookModel book = new BookModel();
        book.setCategory("PROGRAMMING");
        book.setTitle("Apache Camel Developer's Cookbook");
        book.setTitleLanguage("en");
        book.setAuthor1("Scott Cranton");
        book.setAuthor2("Jakub Korab");
        book.setPublishDate(simpleDateFormat.parse("Dec-2013"));
        book.setPrice(BigDecimal.valueOf(49.99));

        Map<String, Object> bookEntry = new HashMap<String, Object>();
        bookEntry.put(BookModel.class.getCanonicalName(), book);
        books.add(bookEntry);
View Full Code Here

Examples of org.camelcookbook.transformation.csv.model.BookModel

        final List<Map<String, BookModel>> response = CastUtils.cast(template.requestBody("direct:unmarshal", request, List.class));

        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM-yyyy");

        BookModel book1 = new BookModel();
        book1.setCategory("PROGRAMMING");
        book1.setTitle("Camel in Action");
        book1.setTitleLanguage("en");
        book1.setAuthor1("Claus Ibsen");
        book1.setAuthor2("Jon Anstey");
        book1.setPublishDate(simpleDateFormat.parse("Dec-2010"));
        book1.setPrice(BigDecimal.valueOf(49.99));

        BookModel book2 = new BookModel();
        book2.setCategory("PROGRAMMING");
        book2.setTitle("Apache Camel Developer's Cookbook");
        book2.setTitleLanguage("en");
        book2.setAuthor1("Scott Cranton");
        book2.setAuthor2("Jakub Korab");
        book2.setPublishDate(simpleDateFormat.parse("Dec-2013"));
        book2.setPrice(BigDecimal.valueOf(49.99));

        Map<String, BookModel> response1 = response.get(0);
        assertEquals(1, response1.size());

        // Map of <class name String>, <Model object value>
View Full Code Here

Examples of org.camelcookbook.transformation.csv.model.BookModel

    public void testCsvMarshal() throws Exception {
        ArrayList<BookModel> books = new ArrayList<BookModel>();

        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM-yyyy");

        BookModel book = new BookModel();
        book.setCategory("PROGRAMMING");
        book.setTitle("Camel in Action");
        book.setTitleLanguage("en");
        book.setAuthor1("Claus Ibsen");
        book.setAuthor2("Jon Anstey");
        book.setPublishDate(simpleDateFormat.parse("Dec-2010"));
        book.setPrice(BigDecimal.valueOf(49.99));

        books.add(book);

        book = new BookModel();
        book.setCategory("PROGRAMMING");
        book.setTitle("Apache Camel Developer's Cookbook");
        book.setTitleLanguage("en");
        book.setAuthor1("Scott Cranton");
        book.setAuthor2("Jakub Korab");
        book.setPublishDate(simpleDateFormat.parse("Dec-2013"));
        book.setPrice(BigDecimal.valueOf(49.99));

        books.add(book);

        final String response = template.requestBody("direct:marshal", books, String.class);
View Full Code Here

Examples of org.camelcookbook.transformation.csv.model.BookModel

        final List<Map<String, BookModel>> response = CastUtils.cast(template.requestBody("direct:unmarshal", request, List.class));

        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM-yyyy");

        BookModel book1 = new BookModel();
        book1.setCategory("PROGRAMMING");
        book1.setTitle("Camel in Action");
        book1.setTitleLanguage("en");
        book1.setAuthor1("Claus Ibsen");
        book1.setAuthor2("Jon Anstey");
        book1.setPublishDate(simpleDateFormat.parse("Dec-2010"));
        book1.setPrice(BigDecimal.valueOf(49.99));

        BookModel book2 = new BookModel();
        book2.setCategory("PROGRAMMING");
        book2.setTitle("Apache Camel Developer's Cookbook");
        book2.setTitleLanguage("en");
        book2.setAuthor1("Scott Cranton");
        book2.setAuthor2("Jakub Korab");
        book2.setPublishDate(simpleDateFormat.parse("Dec-2013"));
        book2.setPrice(BigDecimal.valueOf(49.99));

        Map<String, BookModel> response1 = response.get(0);
        assertEquals(1, response1.size());

        // Map of <class name String>, <Model object value>
View Full Code Here

Examples of org.camelcookbook.transformation.csv.model.BookModel

        for (Map<String, Object> bookEntry : books) {
            final Book book = new Book();
            final Book.Title title = new Book.Title();

            final BookModel bookModel = (BookModel) bookEntry.get(BookModel.class.getCanonicalName());

            book.setCategory(bookModel.getCategory());

            title.setLang(bookModel.getTitleLanguage());
            title.setValue(bookModel.getTitle());
            book.setTitle(title);

            book.getAuthor().add(bookModel.getAuthor1());

            final String author2 = bookModel.getAuthor2();
            if ((author2 != null) && !author2.isEmpty()) {
                book.getAuthor().add(author2);
            }

            book.setYear(Integer.parseInt(simpleDateFormat.format(bookModel.getPublishDate())));
            book.setPrice(bookModel.getPrice().doubleValue());

            bookstore.getBook().add(book);
        }

        return bookstore;
View Full Code Here

Examples of org.jrest.dao.test.entities.BookModel

    Assert.assertEquals(pk, book.getId());
  }
 
  @Test
  public void testLoadModelByQuery() {
    BookModel model = dao.loadModelByQuery(pk);
    Assert.assertNotNull(model);
    Assert.assertEquals(pk, model.getId());
  }
View Full Code Here

Examples of org.jrest.dao.test.entities.BookModel

    Assert.assertEquals(pk, model.getId());
  }
 
  @Test
  public void testLoadModelByNamedQuery() {
    BookModel model = dao.loadModelByNamedQuery("Book 0");
    Assert.assertNotNull(model);
    Assert.assertEquals(pk, model.getId());
  }
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.