some properties some.url=https://www.some.com 1. @PropertySource - config class @PropertySource("classpath:/my/application/some.properties") or @PropertySources({ @PropertySource("classpath:/my/application/some.properties"), @PropertySource(name="otherProperties", value={"classpath:/my/application/other.properties"}) }) or @PropertySource({"classpath:/my/application/some.properties", "classpath:..
Spring SpEL (Expression Language)은 runtime에 object graph를 query하고 조작하는 강력한 표현언어이다. SpEL 문법은 EL(Unified EL)과 비슷하지만, 메서드 호출과 기본 문자열 템플릿 기능 등 추가적인 기능을 제공한다. OGNL, MVEL, JBoss EL 등의 여러가지 자바 표현언어가 존재하지만 스프링 표현언어는 스프링 포트폴리오의 모든 제품에 걸쳐서 사용할 수 있는 하나의 표현언어를 스프링 커뮤니티에 제공하기 위해서 만들어졌다. SpEL은 기술에 독립적인 API를 기반으로하며 필요에 따라 다른 표현 언어 구현을 통합 할 수 있다. SpEL은 Spring 포트폴리오 내에서 식 평가의 기초로 사용되지만 Spring과 직접 관련이 없으며 독립적으로 사..
클래스파일을 찾는 기준 경로이다. JRE는 application을 실행할때 classpath에 지정된 경로를 참조하여 compile된 class를 찾는다. classpath는 directory와 file을 ","으로 구분한 목록이다. JRE는 classpath에 지정된 경로를 모두 검색해서 특정 클래스 코드가 포함된 class 파일을 찾는다. public static void main(String[] args) { String classpath = System.getProperty("java.class.path"); System.out.print(classpath); } * classpath print
Pojo Java Application 개발시 program argument를 받는 경우, "String[] args" 형태로 받기 때문에 argument가 여러개인 경우 변환하는 코드가 많아지고, 복잡해진다. "Jcommander Parameter"는 argument를 Annotation (@Parameter)로 설정할 수 있어, 가독성과 사용성이 월등히 좋아진다. 사용법을 간단히 소개한다. 1. Argument Class에 @Parameter Annotation으로 조건을 설정한다. import com.beust.jcommander.Parameter; import lombok.Getter; import java.time.LocalDateTime; // * Sample Argument : -profil..
외부에 있는 property를 읽어와서 적용해야하는 상황이 있다. 직접 파일로 읽어와도 좋고 Typesafe에서 제공하는 Config 같은 라이브러리를 사용해도 좋다. 심플하게 property를 읽어올 수 있는 Typesafe Config의 사용 방법을 간략히 소개한다. resource 로 지정된 디렉토리 하위의 property, conf 파일을 읽어온다. property file path/name을 지정하지 않으면 위에서 아래로 이름의 우선순위를 가진다. ConfigFactory.load(); // first-listed are higher priority 1. application.conf (all resources on classpath with this name) 2. application.jso..
Template Engine에서 value path대신 JsonPath의 path를 사용하면 동적으로 Json을 내가 지정한 Template로 변환시킬 수 있다. PebbleEngine pebbleEngine = new PebbleEngine.Builder() .loader(new StringLoader()) .build(); //member source json //{ // "id":1234, // "name":"jack", // "age":20, // "address": { // "address1":"kor", // "address2":"seoul", // "address3":"gangnam" // }, // "phoneNumber":"010-1234-1234", // "email":"abcd@goo..
JsonPath Json String을 Object로 변환하지 않고도 연산자, 함수, 표현식 등의 기능을 수행할 수 있다. JsonPath Online Evaluator Dependency 표현식 dot 표현식 $.store.book[0].title bracket 표현식 $[’store’][‘book’][0][’title’] 연산자 연산자 설명 $ 루트 노드. 모든 Path 표현식은 이 기호로 시작. @ 처리되고 있는 현재 노드. 필터 조건자(expression)에서 사용. * 와일드카드. 모든 요소와 매칭. . Dot 표현식의 자식노드. [start:end] 배열 slice 연산자. [?()] 필터 표현식. 필터 조건자가 참인 경우에 매칭되는 모든 요소를 처리. 함수 min(), max(), avg()..
Gradle 3.0 버전부터 기존에 사용하던 compile이 api와 implementation으로 나뉘어 졌다. - api: 모듈의 dependency를 complie 시점부터 공유한다. - implementation: 모듈의 dependency를 runtime 시점부터 공유한다. java에서 api, implementation을 사용하려면 apply plugin: 'java-library' 를 추가해야 한다. 참고 - https://developer.android.com/studio/build/dependencies?hl=ko 빌드 종속성 추가 | Android Developers Android 스튜디오에서 Gradle 빌드 시스템을 이용하여 빌드 종속성을 추가하는 방법에 관해 알아보세요. devel..
Dependency https://mvnrepository.com/artifact/org.mapstruct/mapstruct-jdk8/1.3.1.Final https://mvnrepository.com/artifact/org.mapstruct/mapstruct-processor 기능 Entity와 DTO, VO의 객체를 Convert 해주는 Mapper를 생성한다. 설정 - build.gradle plugins { ... id 'net.ltgt.apt' version '0.20' } allprojects { ... apply plugin: 'net.ltgt.apt-idea' apply plugin: 'net.ltgt.apt-eclipse' } subprojects { ... dependencies { ...
- Total
- Today
- Yesterday
- DI
- Join Table
- Spring JDBC Template
- scikit-learn
- Discriminate Mapping
- Embeddable Mapping
- spring spel
- SmartLifecycle
- java Equals
- Spring Registrar
- JPA Criteria
- guava
- Typesafe Config
- RetryTemplate
- Charles proxy
- Embedded Mapping
- Mapping
- java EqualsAndHashCode
- java generic
- Spring
- Property
- JPA
- Query DSL
- Registrar
- Criteria
- Sprint RetryTemplate
- 복합키 Mapping
- @Primary
- docker
- Akka
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |