#693 - ENH: Add support for mapping @DbJson to list of scalar types like List<String>

This commit is contained in:
Robin Bygrave
2016-05-05 16:36:16 +12:00
parent 8c86976e68
commit 2c95d9dc9a
30 changed files with 524 additions and 98 deletions
@@ -0,0 +1,57 @@
package com.avaje.tests.model.json;
import com.avaje.ebean.annotation.DbJson;
import com.avaje.ebean.annotation.DbJsonType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Version;
import java.util.ArrayList;
import java.util.List;
@Entity
public class EBasicJsonList {
@Id
Long id;
String name;
@DbJson(length = 100, storage = DbJsonType.VARCHAR)
List<String> tags = new ArrayList<String>();
@Version
Long version;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
}