Guest User

Untitled

a guest
Oct 31st, 2017
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. +---------+------+--------+
  2. | book_id | name | number |
  3. +---------+------+--------+
  4. | 1 | b1 | 123 |
  5. | 2 | b2 | 123 |
  6. | 3 | b3 | 2343 |
  7. +---------+------+--------+
  8. 3 rows in set (0.00 sec)
  9.  
  10. +---------+------+--------+
  11. | book_id | name | number |
  12. +---------+------+--------+
  13. | 1 | b1 | 123 |
  14. | 2 | b2 | 123 |
  15. | 3 | b3 | 2343 |
  16. | 4 | b4 | 22343 |
  17. | 5 | b5 | 43 |
  18. +---------+------+--------+
  19. 5 rows in set (0.00 sec)
  20.  
  21. alter table book nocache
  22.  
  23. # Spring
  24. spring.resources.static-locations=classpath:/static/
  25.  
  26. # MyBatis
  27. mybatis.configuration.map-underscore-to-camel-case=true
  28. mybatis.configuration.local-cache-scope=statement
  29. # DataSource 1
  30. spring.datasource.db1.url=jdbc:oracle:thin:@*******
  31. spring.datasource.db1.username=***
  32. spring.datasource.db1.password=***
  33. spring.datasource.db1.driver-class-bookName=oracle.jdbc.OracleDriver
  34.  
  35. @Mapper
  36. @Qualifier("bookMapper")
  37. public interface BookMapper {
  38. @Select({"select * from book"})
  39. @Options(useCache = false)
  40. @Results({
  41. @Result(property = "bookId",column = "book_id"),
  42. @Result(property = "bookName",column = "book_name"),
  43. @Result(property = "bookNumber",column = "book_number")
  44. })
  45. List<BookEntity> getALL();
  46. // insertBook();
  47. }
  48.  
  49. public class BookEntity {
  50. long bookId;
  51. String bookName;
  52. int bookNumber;
  53.  
  54. //getters and setters
  55.  
  56.  
  57. }
Add Comment
Please, Sign In to add comment