Commit 9912ea86 authored by Mat's avatar Mat

Rename db column to prevent hibenration error (array is reserved word)

parent f1a06574
......@@ -52,8 +52,8 @@ public class IndexImpl {
private HashMap<String, byte[]> updateDictionary;
@Lob
@Column(name = "array", columnDefinition = "BLOB")
byte[][] array;
@Column(name = "sarray", columnDefinition = "BLOB")
byte[][] sarray;
protected IndexImpl() { // jpa only
}
......@@ -86,14 +86,14 @@ public class IndexImpl {
* @return the array
*/
public byte[][] getArray() {
return array;
return sarray;
}
/**
* @param array the array to set
*/
public void setArray(byte[][] array) {
this.array = array;
public void setArray(byte[][] sarray) {
this.sarray = sarray;
}
/**
......@@ -109,7 +109,7 @@ public class IndexImpl {
throws JsonParseException, JsonMappingException, JsonProcessingException, IOException {
// test if index is valid multimap
this.dictionary = uploadIndex.getDictionary();
this.array = uploadIndex.getArray();
this.sarray = uploadIndex.getArray();
this.updateDictionary = new HashMap<String, byte[]>();
this.repositoryName = UUID.randomUUID().toString();
}
......@@ -151,10 +151,10 @@ public class IndexImpl {
NoSuchProviderException, NoSuchPaddingException, IOException, NullPointerException {
List <String> resultList;
if(updateDictionary.size()==0){
resultList = DynRH2LevModifiedMap.query(token.getSearchToken(), dictionary, array, updateDictionary);
resultList = DynRH2LevModifiedMap.query(token.getSearchToken(), dictionary, sarray, updateDictionary);
}
else{
resultList = DynRH2LevModifiedMap.queryFS(token.getSearchToken(), dictionary, array, updateDictionary);
resultList = DynRH2LevModifiedMap.queryFS(token.getSearchToken(), dictionary, sarray, updateDictionary);
}
return new SearchResult(resultList);
......
......@@ -54,7 +54,7 @@ public static void cleanup() throws IOException{
@Test
public void IndexImplConstructorSuccessTest()throws Exception {
IndexImpl index = new IndexImpl(new UploadIndexdynrh2levMap(TestUtil.dic, TestUtil.getArray()));
assertArrayEquals(index.array[0], "test1".getBytes());
assertArrayEquals(index.sarray[0], "test1".getBytes());
assertFalse(index.getRepositoryName().isEmpty());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment