Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +---------+------+--------+
- | book_id | name | number |
- +---------+------+--------+
- | 1 | b1 | 123 |
- | 2 | b2 | 123 |
- | 3 | b3 | 2343 |
- +---------+------+--------+
- 3 rows in set (0.00 sec)
- +---------+------+--------+
- | book_id | name | number |
- +---------+------+--------+
- | 1 | b1 | 123 |
- | 2 | b2 | 123 |
- | 3 | b3 | 2343 |
- | 4 | b4 | 22343 |
- | 5 | b5 | 43 |
- +---------+------+--------+
- 5 rows in set (0.00 sec)
- alter table book nocache
- # Spring
- spring.resources.static-locations=classpath:/static/
- # MyBatis
- mybatis.configuration.map-underscore-to-camel-case=true
- mybatis.configuration.local-cache-scope=statement
- # DataSource 1
- spring.datasource.db1.url=jdbc:oracle:thin:@*******
- spring.datasource.db1.username=***
- spring.datasource.db1.password=***
- spring.datasource.db1.driver-class-bookName=oracle.jdbc.OracleDriver
- @Mapper
- @Qualifier("bookMapper")
- public interface BookMapper {
- @Select({"select * from book"})
- @Options(useCache = false)
- @Results({
- @Result(property = "bookId",column = "book_id"),
- @Result(property = "bookName",column = "book_name"),
- @Result(property = "bookNumber",column = "book_number")
- })
- List<BookEntity> getALL();
- // insertBook();
- }
- public class BookEntity {
- long bookId;
- String bookName;
- int bookNumber;
- //getters and setters
- }
Add Comment
Please, Sign In to add comment