当前位置: 首页>>代码示例>>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;未经允许,请勿转载。