1. 우분투 리눅스에 gitlab-runner 설치 Install GitLab Runner manually on GNU/Linux | GitLab Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner. docs.gitlab.com 2. runners 등록하기 GitLab 저장소 -> Settings -> CI/CD -> Runners -> Expand 만약 아래와 같이 초록색 동그라미가 보인다면 다시 등록할 필요가 없다. 그렇지 않다면 아래 내용을 띄워둔다. 그리고 개발 서버 터미널에서 아래와 같이 명령어를 입력하고 등록 과정을 진행한다. sudo gitlab-runner..
프록시란? 엔티티가 실제 사용될 때까지 데이터베이스 조회를 지연하는 방법을 제공하는데 이것을 지연 로딩이라 한다. 지연 로딩 기능을 사용하기 위해 실제 엔티티 객체 대신에 데이터베이스 조회를 지연할 수 있는 가짜 객체가 필요한데 이것을 프록시 객체라 한다. 프록시 사용 엔티티를 실제 사용하는 시점까지 데이터베이스 조회를 미루고 싶으면 EntityManager.getReference() 메소드를 사용하면 된다. Member member = em.getReference(Member.class, "Member1"); PersistenceUnitUtil.isLoaded(Object entity) 메소드를 사용하면 프록시 인스턴스의 초기화 여부를 확인할 수 있다. boolean isLoad = em.getEnti..
상속 관계 매핑 1. 조인전략 Joined Strategy: 엔티티 각각을 모두 테이블로 만들고 자식 테이블이 부모 테이블의 기본 키를 받아서 기본 키 + 외래 키로 사용하는 전략 @Entity @Inheritance(strategy = InheritanceType.JOINED) //조인 전략 사용 @DiscriminatorColumn //컬럼명:dtype public abstract class Item { @Id @GeneratedValue @Column(name = "ITEM_ID") private Long id; private String name; private int price; } @Entity //@DiscriminatorValue("A") //DiscriminatorValue를 지정하지 않..
객체의 참조와 테이블의 외래 키 매핑 방향 방향은 객체에만 존재하고 테이블 관계는 항상 양방향이다. 단방향 두 관계 중 한 쪽만 참조하는 것 양방향 두 관계 양쪽 모두 서로 참조하는 것 다중성 다대일(N:1), 일대다(1:N), 일대일(1:1), 다대다(N:N)이 있다. 연관관계의 주인 객체를 양방향 연관관계로 만들면 연관관계의 주인을 정해야 한다. 연관관계의 주인은 외래 키의 위치와 관련해서 정한다. ex) 회원과 팀 관계에서 외래 키가 있는 "다" 쪽인 회원이 연관관계의 주인이 된다. 객체 연관관계와 테이블 연관관계의 차이 객체는 참조(주소)로 연관관계를 맺는다. ex) a.getB().getC() 테이블은 외래 키로 연관관계를 맺는다. ex) A JOIN B 참조를 사용하는 객체의 연관관계는 단방향..
객체와 테이블 매핑 @Entity @Entity가 붙은 클래스를 엔티티라 부른다. 테이블과 매핑할 클래스에 붙는다. 기본 생성자(파라미터가 없는 생성자)는 필수다. @Table 엔티티와 매핑할 테이블을 지정 ex) Table(name="MEMBER") 생략하면 엔티티 이름을 테이블 이름으로 사용한다. 기본 키 매핑 직접 할당 전략 : 기본 키를 애플리케이션에서 직접 할당한다. @Id @Column(name = "Id") private String id; Board board = new Board(); board.setId("id1");//기본 키 직접 할당 em.persist(board); 자동 생성 전략 : 대리 키 사용 방식 IDENTITY : 기본 키 생성을 데이터베이스에 위임 ex) MySQL @..
Entity Manager Factory Entity Manager를 만드는 공장 만드는 비용이 크기 때문에 애플리케이션 전체에서 하나만 만들어서 공유하도록 설계 Entity Manager 만드는 비용이 거의 들지 않는다. 여러 스레드가 동시에 접근하면 동시성 문제가 발생하므로 스레드 간에 절대 공유하면 안 된다. 영속성 컨텍스트(persistence context) Entity Manager를 생성할 때 하나 만들어진다. Entity Manager를 통해 영속성 컨텍스트에 접근하고 관리한다. 영속성 컨텍스트는 Entity를 식별자 값으로 구분하기 때문에 식별자 값이 반드시 있어야 한다. transaction을 commit하는 순간 영속성 컨텍스트에 저장된 entity를 데이터베이스에 반영한다.(flus..
brew tap AdoptOpenJDK/openjdk brew search jdk brew install --cask adoptopenjdk11 자바 설치 확인 java --version 참고 homebrew로 openjdk 설치하기 Software Developer, I love code. findstar.pe.kr Mac에서 Open JDK 설치하기 기초중의 기초지만 운영체제가 바뀌면 어리둥절하기 마련이죠! 맥에 JDK를 설치하는 방법이 있지만, 이번엔 홈브류HomeBrew를 통해 빠르게 설치해보려고 합니다. 홈브류란 npm의 애플 버전이라고 timevoyage.tistory.com
1. 공식 홈페이지에서 설치 명령어 복사 brew.sh/index_ko 2. 터미널 실행 후 복사한 명령어 붙여넣고 실행 3. 환경 변수 설정 zsh 설정 파일을 열어서 vi ~/.zshrc 아래 내용을 추가하고 저장한다. export PATH="/opt/homebrew/bin:$PATH" 4. 터미널을 종료 후 재실행 5. Homebrew 설치 확인 brew doctor "Your system is ready to brew." 이라 나오면 설치 완료 참고 Homebrew의 Apple Silicon (M1) 정식 지원 시작, 설치 방법 Homebrew on Apple Silicon 사실 정식 지원을 시작한 지는 이제 2주정도 되었습니다. ㅎㅎ brew.sh/2021/02/05/homebrew-3.0.0/..
1. Dock 자동 가리기 시스템 환경설정 - Dock 및 메뉴 막대 - "자동으로 Dock 가리기와 보기" 체크 2. Finder 경로 막대 보기와 상태 막대 보기 Finder 메뉴 - 보기 - 경로 막대 보기, 상태 막대 보기 경로 막대, 상태 막대 확인 3. Finder 계층 보기 상단 중앙에 계층 보기 아이콘을 클릭 4. 스크롤 막대 보기 시스템 환경설정 - 일반 - 스크롤 막대 보기 - "항상" 체크 5. Finder에서 파일명 확장자 표시 및 폴더 먼저 정렬되도록 하기 Finder - 환경설정... 고급 탭 - "모든 파일 확장자 보기", "윈도우에서(이름순으로 정렬 시)" 체크 6. 키보드 자동 완성 끄기 시스템 환경설정 - 키보드 - 텍스트 탭 "맞춤법 자동 수정" 체크 해제 "자동으로 문..
MacOS의 기본 설정은 Fn키가 기본으로 사용되도록 설정되어 있다. F1 ~ F12키를 사용하려면 Fn키와 함께 눌러서 사용해야 하는데 F1 ~ F12키가 기본으로 사용되도록 설정하려고 한다. 1. 시스템 환경설정 - 키보드 2. "F1, F2 등의 키를 표준 기능 키로 사용" 체크 참고 맥북 펑션키 (fn) 특수 기능키(밝기조절, 음량조절, 키보드조명) 사용하는 두가지 방법 맥북 펑션키 사용하는 두가지 방법맥북을 사용하면서 기능키를 사용하기 위해서는 Fn 키와 조합해서 누르... blog.naver.com