當前位置: 首頁>>代碼示例>>Java>>正文


Java BookDTO類代碼示例

本文整理匯總了Java中ch.bfh.swos.bookapp.service.dto.BookDTO的典型用法代碼示例。如果您正苦於以下問題:Java BookDTO類的具體用法?Java BookDTO怎麽用?Java BookDTO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BookDTO類屬於ch.bfh.swos.bookapp.service.dto包,在下文中一共展示了BookDTO類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
@Test
public void test() {

	// Create
	BookDTO newBook = new BookDTO();
	newBook.setTitle("Test");
	newBook = bookService.create(newBook);

	// Read
	BookDTO readBook = bookService.read(newBook.getId());
	Assert.assertTrue(newBook.getTitle().equals(readBook.getTitle()));

	// Update
	readBook.setTitle("Test2");
	readBook = bookService.update(readBook);
	BookDTO updatedBook = bookService.read(readBook.getId());
	Assert.assertTrue(readBook.getTitle().equals(updatedBook.getTitle()));

	// Delete
	bookService.delete(updatedBook);
	BookDTO deletedBook = bookService.read(readBook.getId());
	Assert.assertNull(deletedBook);
}
 
開發者ID:rvillars,項目名稱:ch.bfh.swos.bookapp.parent,代碼行數:24,代碼來源:BookServiceIT.java

示例2: test

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
@Test
public void test() {

    // Create
    BookDTO newBook = new BookDTO();
    newBook.setTitle("Test");
    newBook = bookService.create(newBook);

    // Read
    BookDTO readBook = bookService.read(newBook.getId());
    Assert.assertTrue(newBook.getTitle().equals(readBook.getTitle()));

    // Update
    readBook.setTitle("Test2");
    readBook = bookService.update(readBook);
    BookDTO updatedBook = bookService.read(readBook.getId());
    Assert.assertTrue(readBook.getTitle().equals(updatedBook.getTitle()));

    // Delete
    bookService.delete(updatedBook);
    BookDTO deletedBook = bookService.read(readBook.getId());
    Assert.assertNull(deletedBook);
}
 
開發者ID:rvillars,項目名稱:bookapp-rest,代碼行數:24,代碼來源:BookServiceIT.java

示例3: create

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Create
 */
@RequestMapping(method = RequestMethod.POST)
public BookDTO create(@RequestBody BookDTO book) {
    BookDTO createdBook = bookService.create(book);
    System.out.println("Book created with id = " + createdBook.getId());
    return createdBook;
}
 
開發者ID:rvillars,項目名稱:bookapp-nextgen,代碼行數:10,代碼來源:BookController.java

示例4: update

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Update
 */
@RequestMapping(value = "{id}", method = RequestMethod.PUT)
public BookDTO update(@RequestBody BookDTO book, @PathVariable long id) {
    BookDTO updatedBook = bookService.update(book);
    System.out.println("Book updated with id = " + updatedBook.getId());
    return updatedBook;
}
 
開發者ID:rvillars,項目名稱:bookapp-nextgen,代碼行數:10,代碼來源:BookController.java

示例5: delete

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Delete
 */
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
public void delete(@PathVariable long id) {
    BookDTO book = bookService.read(id);
    bookService.delete(book);
    System.out.println("Delete Book with id = " + id);
}
 
開發者ID:rvillars,項目名稱:bookapp-nextgen,代碼行數:11,代碼來源:BookController.java

示例6: createBook

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Create
 */
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public BookDTO createBook(@RequestBody BookDTO book) {
	BookDTO createdBook = bookService.create(book);
	System.out.println("Book created with id = " + createdBook.getId());
	return createdBook;
}
 
開發者ID:rvillars,項目名稱:ch.bfh.swos.bookapp.parent,代碼行數:11,代碼來源:BookController.java

示例7: getBooks

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * ReadAll
 */
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public Collection<BookDTO> getBooks() {
	System.out.println("Collection of Book requested");
	return bookService.list();
}
 
開發者ID:rvillars,項目名稱:ch.bfh.swos.bookapp.parent,代碼行數:10,代碼來源:BookController.java

示例8: getBook

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Read
 */
@RequestMapping(value = "{id}", method = RequestMethod.GET)
@ResponseBody
public BookDTO getBook(@PathVariable long id) {
	System.out.println("Book requested with id = " + id);
	return bookService.read(id);
}
 
開發者ID:rvillars,項目名稱:ch.bfh.swos.bookapp.parent,代碼行數:10,代碼來源:BookController.java

示例9: updateBook

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Update
 */
@RequestMapping(method = RequestMethod.PUT)
@ResponseBody
public BookDTO updateBook(@RequestBody BookDTO book) {
	BookDTO updatedBook = bookService.update(book);
	System.out.println("Book updated with id = " + updatedBook.getId());
	return updatedBook;
}
 
開發者ID:rvillars,項目名稱:ch.bfh.swos.bookapp.parent,代碼行數:11,代碼來源:BookController.java

示例10: deleteBook

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Delete
 */
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
public void deleteBook(@PathVariable long id) {
	BookDTO book = bookService.read(id);
	bookService.delete(book);
	System.out.println("Delete Book with id = " + id);
}
 
開發者ID:rvillars,項目名稱:ch.bfh.swos.bookapp.parent,代碼行數:11,代碼來源:BookController.java

示例11: create

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Create
 */
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public BookDTO create(@RequestBody BookDTO book) {
    BookDTO createdBook = bookService.create(book);
    System.out.println("Book created with id = " + createdBook.getId());
    return createdBook;
}
 
開發者ID:rvillars,項目名稱:bookapp-rest,代碼行數:11,代碼來源:BookController.java

示例12: list

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * ReadAll
 */
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public Collection<BookDTO> list() {
    System.out.println("Collection of Book requested");
    return bookService.list();
}
 
開發者ID:rvillars,項目名稱:bookapp-rest,代碼行數:10,代碼來源:BookController.java

示例13: read

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Read
 */
@RequestMapping(value = "{id}", method = RequestMethod.GET)
@ResponseBody
public BookDTO read(@PathVariable long id) {
    System.out.println("Book requested with id = " + id);
    return bookService.read(id);
}
 
開發者ID:rvillars,項目名稱:bookapp-rest,代碼行數:10,代碼來源:BookController.java

示例14: update

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * Update
 */
@RequestMapping(value = "{id}", method = RequestMethod.PUT)
@ResponseBody
public BookDTO update(@RequestBody BookDTO book, @PathVariable long id) {
    BookDTO updatedBook = bookService.update(book);
    System.out.println("Book updated with id = " + updatedBook.getId());
    return updatedBook;
}
 
開發者ID:rvillars,項目名稱:bookapp-rest,代碼行數:11,代碼來源:BookController.java

示例15: list

import ch.bfh.swos.bookapp.service.dto.BookDTO; //導入依賴的package包/類
/**
 * ReadAll
 */
@RequestMapping(method = RequestMethod.GET)
public Collection<BookDTO> list() {
    System.out.println("Collection of Book requested");
    return bookService.list();
}
 
開發者ID:rvillars,項目名稱:bookapp-nextgen,代碼行數:9,代碼來源:BookController.java


注:本文中的ch.bfh.swos.bookapp.service.dto.BookDTO類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。