전체 글378 spring boot jpa(querydsl) spring boot 에서 jpa 사용 기본적으로 제공되는 findByXXX, 와 같은 기능들은 문제없이 사용 된다. repository를 실제고 구현 해야 할때는 추가적으로 해야 할 설정이있다. ( 개인 적인 생각?) cusmtom repository 를 구현 하려면 데이터 소스에 대한 설정을 해주어한다. member jpa model : datasourceconfig: repository class 다이어그램 : repository 인터페이스를 구현 할 클래스의 이름은 무조건(?) 해당 repository + impl 을 붙여야 한다. 데모프로젝트 패키지 구조 : 해당 데모 프로젝트 소스 application.properties:spring.profiles.active=production#server.. 2015. 10. 20. Spring data jpa cascade 관련 오류 Caused by: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing 위와 같은 오류는 JoinColumn 에 대해 cascadeType을 설정 하지 않아 발생 한것이다. @OneToOne(cascade={CascadeType.ALL})@JoinColumn(name="relationID") 2015. 10. 15. java grok pattern 파일에서 line by line 으로 문자열 리스트를 읽어온 후 해당 문자열 리스트들을 Grok 패턴의 정의에 따라 문자열 리스트 맵을 구성 할 수있는 함수이다. public List makeResultList(List strList, String expression)throws Exception {List resultList = new ArrayList();final GrokDictionary dictionary = new GrokDictionary();dictionary.addBuiltInDictionaries();dictionary.bind();Grok compiledPattern = dictionary.compileExpression(expression);if(strList !=null && !e.. 2015. 10. 12. 디렉터리의 특정패턴의 파일 리스트 가져오기 // 해당 디렉토리의 특정 패턴으로 된 파일이름 리스트가져오기public String[] getFileList(String path,final String pattern){File file = new File(path);String fileList[] = file.list(new FilenameFilter(){@Overridepublic boolean accept(File dir, String name) {return name.startsWith(pattern);}});return fileList;} 2015. 10. 12. Path 를 사용하자. 기존 파일 처리 방법: File file = new File("test.txt"); 자바 7 에서 파일 처리 방법: Path path = Paths.get("test.txt"); Path 는 파일 시스템의 경로를 프로그램으로 표현한 것.경로 문자열에는 파일이름,디렉터리 목록, 운영체제에서 사용하는 파일 구분자(MS 역슬래기\, 솔라리스와 리눅스 슬래시 / ) 에 독립적이지 않다. Path 로 할수있는것: 파일/디렉터리 이름 가져오기 경로 루트 가져오기 경로의 부모 가져오기 경로의 이름 요소 가져오기 서브경로 가져오기 경로 변환하기 경로를 문자열로 변환하기 경로를 URI 로 변환하기 상대경로를 절대 경로로 변환하기 경로를 실제 경로로 변환하기 경로를 파일로 변환하기 두 경로를 조합하기 두 위치 사이의 경로.. 2015. 10. 12. JAVA 7 파일 과 경로 변환 방법 경로를 파일로 변환 하기 File path_to_file = path.toFile(); 파일을 경로로 변환하기 Path file_to_path = path_to_file.toPath(); 2015. 10. 12. 이전 1 ··· 37 38 39 40 41 42 43 ··· 63 다음