[OrderPost ํ ์ด๋ธ]
@Getter @ToString
public class OrderPost {
private Long id;
private String orderId;
private Long postId;
private int count;
}
@Mapper
@Repository
public interface OrderRepository {
@Select("select * from orderpost")
List<OrderPost> getOrders();
}
์ฝ๋์ ๋ฌธ์ ๊ฐ ์๋๊ฑฐ๊ฐ์๋ฐ.. ์๋์ ๊ฐ์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค.
(์๋ ์ด๋ ๊ฒ ๊ฐ๋จํ ์ฝ๋์ ๋ฌธ์ ๋๊ฒ ๋ญ๊ฐ์์ด ๋์ฒด..ใ ใ )
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'orderid' from result set. Cause: java.sql.SQLException: Out of range value for column 'orderid' : value 2201251714720e1a
; Out of range value for column 'orderid' : value 2201251714720e1a; nested exception is java.sql.SQLException: Out of range value for column 'orderid' : value 2201251714720e1a] with root cause
java.sql.SQLException: Out of range value for column 'orderid' : value 2201251714720e1a
at org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.TextRowProtocol.getInternalLong(TextRowProtocol.java:348) ~[mariadb-java-client-2.7.4.jar:na]
at org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.TextRowProtocol.getInternalInt(TextRowProtocol.java:254) ~[mariadb-java-client-2.7.4.jar:na]
...
๊ตฌ๊ธ์ ๊ฒ์ํ์๋๋ ๋ค ์ซ์ํ์์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋๊ฑด๋ฐ
๋ฌธ์ ๋๋ orderid๋ฅผ varchar๋ก ์ง์ ํ๊ณ ๊ธธ์ด๋ 200์ผ๋ก ์์ฒญ ๋๋ํ๋ค
์ ์ฅ๋ ๋ฌธ์์ด์ 2๊ธ์๋ก ํด๋ด๋, ์ธ๋ํค๋ฅผ ๋ค ์์ ๋ด๋ ๋๊ฐ์ ์ค๋ฅ๋ง ๋ฐ์ํ๋ค
๊ทผ๋ฐ ์ ๋ง ์ด์ด์๊ฒ ํด๊ฒฐํ๋ค
orderid ์์๋ฅผ ๋ฐ์ผ๋ก ๋ด๋ ธ๋ค
๊ทธ๋ฌ๋๋ ๋๋ค
....
....
.....??
์๋ ๋ด๊ฐ ์ ๋ชฐ๋ผ์๊ทธ๋ฌ๋๋ฐ.. ์ธ๋ํค๋ฅผ ์์ ๋ ์ค๋ฅ๊ฐ ๋ฌ์๋๋ฐ
๋์ฒด ๋ญ๊ฐ ๋ฌธ์ ์๋๊ฑฐ๋..???????????