본문 바로가기

프로그래밍언어/Java

org.hibernate.AnnotationException: referencedColumnNames(columnName) of ... referencing ... not mapped to a single property org.hibernate.AnnotationException: referencedColumnNames(columnName) of A... referencing B... not mapped to a single property at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:180) at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:88) at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:456) at org.. 더보기
JPA구현을 Unitils + DBUnit으로 테스트를 수행할 때 제약사항 오류의 원인과 해결방안 JPA구현을 Unitils + DBUnit으로 테스트를 수행할 때 다음과 같은 에러가 발생한 경우 DBUnit이 초기화하는 테이블의 순서에 주의해야한다. 즉, A OneToMany B, C OneToMany B 와 같이 정의한 경우 A, C, B 순서로 정의해야만한다. 이때 DBUnit은 A, C, B의 순서로 데이터를 로드하고 B, C, A의 순서로 클리어한다. 그런나 만약 B를 C앞에 정의하게 되면 다시말해 A, B, C의 순서로 정의하면 삭제할 때 아래와 같은 제약사항 오류를 보게된다. 참고: http://forum.springsource.org/showpost.php?s=5f4929b80567b656c37d502cba2100d3&p=152482&postcount=8 Caused by: org.un.. 더보기
struts OGNL에서 static method 사용하기 사실 포스팅 하기에는 너무 간다한한 내용이라 망설여지긴 하지만 알면 간단하나 모르면 너무 어려운것이므로...^^; 와 같이 한줄을 struts.xml 이나 struts.properties 에 추가해 주면 된다. 그리고 와 같이 사용하면 된다. 사실 정적메소드 접근에 대한 기본값이 false 이므로 http://www.opensymphony.com/ognl/html/LanguageGuide/staticMethods.html 에서 설명하는 내용이 동작하지 않는 것처럼 보이고 이런 내용이 인터넷 상에 다수 보이고 있다. ㅋㅋ 사실 나도 왜 안나오나 하고 순간 당황 ^^; 해결방법 참고사이트: http://marc.info/?l=struts-user&m=121481314624086&w=2 더보기
struts에서 ContextPath 사용하기 "올바른 성장과 따뜻한 나눔" ${pageContext.request.contextPath} 1. [${ctx}] 2. [] 3. [] 참간단해 보이지만 또 막상 사용하려고 하면 서핑을 하게 됩니다. 또한 거의 대부분 ${pageContext.request.contextPath}와 같은 방식만 언급되어 있지 변수로 선언하고 설정한 다음 사용하는 방법에 대해서는 언급이 없습니다. 그래서 간단하게 접근하기 위한 방법을 공유합니다. 위에서 3가지 방법으로 접근하는 방법을 소개하고 있는데 ${}방식은 프리마커 스타일이구요 밑에 두가지 방식은 OGNL 방식입니다. (결과는 같지만 %{}는 non-String 일때 문자열로 분석하게 하는 기능입니다. 여기서는 필요가 없죠?.. ㅎㅎ 그래도 이런 표현도 있다는 것을 .. 더보기
HttpClient의 GetMethod 사용시 URL의 한글처리 GetMethod 사용시 [코드1]과같이 URL을 생성하고 실행하면 [코드2]와 같은 예외가 발생한다. [코드1] // Create a method instance. StringBuilder searchURL = new StringBuilder(this.urlRoot + "/term/search.json"); searchURL.append('?').append("dictionaryId").append('=').append(dictionary.getId()); searchURL.append('&').append("queryString").append('=').append(queryString); searchURL.append('&').append("start").append('=').append(0); G.. 더보기
Content-Type 정리 contentType application/acad AutoCAD drawing files dwg application/clariscad ClarisCAD files ccad application/dxf DXF (AutoCAD) dxf application/msaccess Microsoft Access file mdb application/msword Microsoft Word file doc application/octet-stream Uninterpreted binary bin application/pdf PDF (Adobe Acrobat) pdf application/postscript-x PostScript-x, encapsulated PostScript-x, Adobe Illustrator ai.. 더보기