spring
IoC/DI
- 스프링은 컨테이너다
- Ioc(역제어) : 객체관리 주체가 컨테이너(팩토리빈<-어플리케이션컨텍스트)
- DI(의존성관리) : 1.생성자 2.세터 <bean <constructor-arg <property
- 수동 <bean
- 자동스캔
<context:component-scan base-package
@Component
@Controller
@Service
@Repository
@Autowired
@Qualifier
board?no=1
board?no= ''
board? null
- spring은 객체 컨테이너
- BeanFactory ← AnnotationConfigApplicationContext (자바기반설정) GenericXmlApplicationcontext (xml기반설정) ```java AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AppContext.class);
```java
com.yedam.app.advice
LogAspect
com.yedam.app.emp.service
EmpService
com.yedam.app.emp.service.impl
EmpServiceImpl
List<Dept>
no<select id="selectPostIn" resultType="domain.blog.Post">
SELECT *
FROM POST P
WHERE ID in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
name
List<Emp>
프로젝트명 변경
-
폴더명 변경
- 프로젝트명 변경 : .project
<name>book00</name> - artifactId : pom.xml
<artifactId>book00</artifactId> - context-root 변경 : .settings/org.eclipse.wst.common.component
<property name="context-root" value="book00"/>
camelCase Map
import java.util.HashMap;
import org.springframework.jdbc.support.JdbcUtils;
public class CustoMap extends HashMap<String, Object> {
@Override
public Object put(String key, Object value) {
return super.put(JdbcUtils.convertUnderscoreNameToPropertyName(key), value);
}
}