목록Spring (4)
개발
이슈 springboot에서 test코드 작성시에 기초데이터를 insert하는 방법은 여러가지가 있겠지만 data.sql을 이용해보려고 한다. data.sql을 이용해 기초데이터를 넣어보려고한다. Member entity는 다음과같다. @Entity public class Member extends BaseEntity{ @Id @GeneratedValue @Column(name = "MEMBER_ID") private Long id; //...생략 } data.sql은 다음과 같다. INSERT INTO member (member_id,create_date,update_date,bio,email,image,password,username) VALUES (1,'2022-08-03 09:20:17.9..
- context-properties.xml 설정 자주사용하는 값을 key value로 관리할 수 있다. - 호출방법 @Resource(name = "propertiesService") protected EgovPropertyService pService; String savePath = pService.getString("Globals.fileStorePath"); - 서버 시작시 EgovPropertyServiceImpl클래스의 egovProperties변수에 key,value를 넣어준다. 해당소스 /** * Bean 초기화 함수로 최초 생성시 필요한 Property 세티처리 * * @throws Exception fail to initialize */ @SuppressWarnings({ "rawty..
sqlSessionFactory에 추가 1.3.0 버전 부터 configuration 속성이 추가되었다. 다음과 같이 MyBatis XML 설정 파일없이 Configuration 인스턴스를 직접 지정할 수 있습니다.