에러 내용 :
java.lang.Error: Unresolved compilation problem:
 The method get(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)


위와 같은 에러는 JDK1.5 버전 환경으로 개발을 한후 기본 데이터 타입을 클래스 파일로 형변환 해주지 않은체로 JDK1.5 이하 버전에서 사용을해서 생기는 문제.

인자값으로 받는 기본 데이터 타입은 Serializable 인터페이스를 구현하여 정렬화 해야 함.
JDK1.5 부터는 기본 데이터 타입에서 자동으로 정렬화 해주지만.
JDK1.4 이하 버전은 되지 않기때문에 해당 데이터 타입의 클래스로 캐스팅을 해주어야 함.

String 클래스
public final class String implements java.io.Serializable, Comparable<String>, CharSequence{구현부분}

Integer 클래스
Integer 클래스가 상속받은 Number 추상 클래스에서 Serializable을 상속받음.
public abstract class Number implements java.io.Serializable {구현부분}
public final class Integer extends Number implements Comparable<Integer> {}


### 소스 적용 ###

 public List selectBranchList(int parentSeq) {
  return getHibernateTemplate().findByNamedQuery("writingBranch.selectBranchList", new Integer(parentSeq));
 }


# 위의 new Integer() 부분과 같이 selectBranchList() 멤버 메소드에서 받는 값의 형태가 int 일경우 int의 랩퍼클래스인 Integer 객체를 생성해서 정렬화를 해줌.

12 2, 2008 16:37 12 2, 2008 16:37

Trackback URL : http://develop.sunshiny.co.kr/trackback/27

Leave a comment

« Previous : 1 : ... 359 : 360 : 361 : 362 : 363 : 364 : 365 : 366 : 367 : ... 381 : Next »

Recent Posts

  1. Oracle - 바인드 변수에 대하여(테스트)
  2. Oracle - 디폴트 롤, DBA, CONNECT,...
  3. Oracle - 권한 및 롤 관리
  4. Oracle - SQL*PLUS의 SYSDBA 접근 제어
  5. Oracle - PFILE, SPFILE 에 관하여

Recent Comments

  1. 네 답글 고맙습니다. 좋은 한주 보... sunshiny 05 14,
  2. 좋은 정보 잘 살펴보고 갑니다. ememoho 05 12,
  3. 네. 고맙습니다^^ 행복한 한해 보... sunshiny 01 16,
  4. sunshiny님. 안녕하세요... 올려 주... yihans 01 16,
  5. 답글 주셔서 고맙습니다^^ 소스 복... sunshiny 01 11,

Recent Trackbacks

  1. 윈도우 cmd 명령어 팁 월풍도원(月風道院) - Delight on th... %M
  2. 파일 압축 Like RadioHead %M
  3. Mysql - mysql 설치후 Character set... 멀고 가까움이 다르기 때문 %M

Calendar

«   05 2012   »
    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 29 30 31    

Bookmarks

  1. 위키피디아
  2. MysqlKorea
  3. Oracle All Documentation
  4. 엑셈
  5. 오라클 클럽
  6. 네이버개발자센터
  7. API - Java
  8. API - Spring
  9. Java Community
  10. Reference - Spring
  11. 스프링사용자
  12. 자바소스
  13. 자바지기
  14. Ready System
  15. Solaris Freeware
  16. Linux-Site
  17. RedHat Korea
  18. 윈디하나의 솔라나라

Site Stats

TOTAL 245419 HIT
TODAY 125 HIT
YESTERDAY 139 HIT