전체보기
-
[Java] 스트림(Stream)의 생성Java/Stream(스트림) 2022. 7. 12. 22:34
목차 스트림(Stream)의 생성1. Stream.of()를 사용하는 방법Stream.of()로 생성하려는 객체를 입력하면, 새로운 스트림을 반환합니다.public static void createStreamOf() { Stream stream = Stream.of("Python", "C", "Java", "C++", "Visual Basic"); stream.forEach(System.out::println);}Console Output 2. Stream.builder() 를 사용하는 방법Stream.builder()로 생성하려는 객체를 추가한 후 build()를 호출하면, 새로운 스트림을 반환합니다.public static void createStreamBuilder() { Stream stre..
-
[MongoDB] MongoDB - 문자열 연산자, LIKE 검색NoSQL/MongoDB 2022. 7. 5. 17:17
Example Collectiondb.products.insertMany([ { "_id" : 1, "name" : "xPhone", "price" : 799, "releaseDate" : ISODate("2011-05-14T00:00:00Z"), "spec" : { "ram" : 4, "screen" : 6.5, "cpu" : 2.66 }, "color" : [ "white", "black" ], "storage" : [ 64, 128, 256 ] }, { "_id" : 2, "name" : "xTablet", "price" : 899, "releaseDate" : ISODate("2011-09-01T00:00:00Z"), "spec" : { "ram" : 16, "screen" : 9.5, "cpu"..
-
[MongoDB] MongoDB - 논리 연산자(Logical Operator)NoSQL/MongoDB 2022. 7. 5. 15:16
논리 연산자는 쿼리안의 조건들의 논리적 연결을 위해서 사용되며, 단독으로는 존재할 수 없고, 다른 연산자와 연계해서 사용합니다. Example Collectiondb.products.insertMany([ { "_id" : 1, "name" : "xPhone", "price" : 799, "releaseDate" : ISODate("2011-05-14T00:00:00Z"), "spec" : { "ram" : 4, "screen" : 6.5, "cpu" : 2.66 }, "color" : [ "white", "black" ], "storage" : [ 64, 128, 256 ] }, { "_id" : 2, "name" : "xTablet", "price" : 899, "releaseDate" : ISODa..
-
[MongoDB] MongoDB - 비교 연산자(Comparison Operator)NoSQL/MongoDB 2022. 7. 4. 18:42
비교 연산자는 어떤 값보다 크고 작은지 또는 같고 다른지에 대한 계산을 하는 연산자입니다. Example Collectiondb.products.insertMany([ { "_id" : 1, "name" : "xPhone", "price" : 799, "releaseDate": ISODate("2011-05-14"), "spec" : { "ram" : 4, "screen" : 6.5, "cpu" : 2.66 },"color":["white","black"],"storage":[64,128,256]}, { "_id" : 2, "name" : "xTablet", "price" : 899, "releaseDate": ISODate("2011-09-01") , "spec" : { "ram" : 16, "s..
-
[Spring Boot] 유효성 검사 처리 (Custom Validation)Spring Boot/기타 2022. 6. 6. 18:46
1. DateValid 구현DateValid.javapackage com.example.customvalidation.annotiaon;import com.example.customvalidation.validator.DateValidator;import java.lang.annotation.Documented;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;import javax.validation.Constraint;import javax.validation.Payload..
-
[Spring Boot] 에러 메시지 처리 (Custom Exception)Spring Boot/기타 2022. 6. 6. 13:07
1. build.gradeplugins { id 'org.springframework.boot' version '2.7.0' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java'}group = 'com.example'version = '0.0.1-SNAPSHOT'sourceCompatibility = '11'repositories { mavenCentral()}dependencies { // spring-boot-starter 의존성 추가 implementation 'org.springframework.boot:spring-boot-starter-validation' implementation..
-
[Docker] Docker로 PostgreSQL 설치(docker-compose.yml)Docker 2022. 5. 20. 16:51
1. PostgreSQL 컨테이너 이미지 가져오기docker pull postgres 2. docker-compose 파일 생성# compose 파일 버전version: "3"services: # 서비스 명 postgresql: # 사용할 이미지 image: postgres # 컨테이너 실행 시 재시작 restart: always # 컨테이너명 설정 container_name: postgres # 접근 포트 설정 (컨테이너 외부:컨테이너 내부) ports: - "5432:5432" # 환경 변수 설정 environment: # PostgreSQL 계정 및 패스워드 설정 옵션 POSTGRES_USER: root ..
-
[IntelliJ] 단축키 기본 및 응용IntelliJ 2022. 3. 29. 17:30
단축키 기본 단축키 설명 Alt + 1 프로젝트 창 포커스 ESC 에디터 창으로 돌아오기 Space 프로젝트 창 미리보기 Ctrl + Shift + F12 에디터 창 키우기 Ctrl + Tab 에디터 창 이동 Ctrl + Alt + Insert 에디터에서 새 파일 생성 Alt + Insert 프로젝트 창에서 새 파일 생성 Ctrl + 방향키(좌/우) 단어별 이동 Home, End 라인 시작/끝 이동 Page Up, Page Down 페이지 위/아래 이동 Ctrl + W, Ctrl + Shift + W 선택 영역 확장/축소 Ctrl + / 라인 단위로 주석 처리(//로 주석처리) Ctrl + Shift + / 블록 단위로 주석 처리(/* */로 주석치리) Tab 인덴트 Shift + Tab 인덴트 취소 C..
-
[IntelliJ] context.xml 추가하기IntelliJ 2022. 3. 23. 15:07
context.xml 추가하기 1. File > Project Structure (Ctrl + Alt + Shift + S) 2. Modules > Web > Add Application Server specific descriptor... 클릭 3. Application Server에서 Tomcat Server를 선택 4. Tomcat Context Descriptor가 추가되었느지 확인 5. META-INF > context.xml이 추가되었는지 확인