2011-04-21 4 views
0

내 도메인의 속성 속성에서 auto_increment를 정의하려고합니다. 하지만 난 couldnT anywhere.is 그게 가능해? 가능한 경우 어떻게 그것을 할 수있는 방법을 확인할 수 있습니까?amazon simpleDB

답변

0

아래의 예는 업로드 할 값이 1024보다 큰 속성 이름을 자동으로 증가시킬 수 있음을 보여줍니다.

if (fieldvalue.length() >= 1024) { 
           int index = 1; 
           while (fieldvalue.length() >= 1000 && vlist.size() < 254) { 
            String value = new String(fieldvalue.substring(0, 1000).getBytes("UTF-8"), "UTF-8"); 

            ItemAttribute objItemAttribute = new ItemAttribute(fieldname+index, value, fieldreplace.booleanValue()); 
            vlist.add(objItemAttribute); 
            fieldvalue = new String(fieldvalue.substring(1000).getBytes("UTF-8"), "UTF-8"); 
            index++; 
           } 
          } 
1

자신 만의 자동 증가 기능을 코딩해야합니다. conditional puts을보세요. 카운터가 아닌 고유 한 식별자를 작성하려는 경우 UUID를 염두에 두십시오. 불필요하게 데이터베이스를 지정하는 것보다 훨씬 쉽고 효율적입니다.

관련 문제