package kr.co.kihyun.beans.entity; import javax.jdo.PersistenceManager; import javax.jdo.annotations.*; import kr.co.kihyun.beans.entity.ecross.IRemotePersistable; import kr.co.kihyun.moumi.MoumiConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true") public class TotTable extends LongEntity implements IRemotePersistable { /** * */ private static final Logger LOG = LoggerFactory.getLogger(TotTable.class); private static final long serialVersionUID = 3289123140434821380L; @Persistent(nullValue = NullValue.EXCEPTION) private TotDoc totDoc; @Persistent(nullValue = NullValue.EXCEPTION) private int num = 1; @Persistent private String name; @Persistent private String note; @Persistent(nullValue = NullValue.EXCEPTION) private TotTableType type = TotTableType.DYNA; @Persistent private int itemSize = 10; @Persistent(nullValue = NullValue.EXCEPTION) private String form; @Persistent private String types; public TotTable() { } public TotTable(TotDoc totDoc) { this.setTotDoc(totDoc); this.setForm(totDoc.getForm()); } public TotDoc getTotDoc() { return this.totDoc; } public void setTotDoc(TotDoc doc) { this.totDoc = doc; } public int getNum() { return this.num; } public void setNum(int num) { this.num = num; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getNote() { return this.note; } public void setNote(String note) { this.note = note; } @Deprecated public static enum TotTableType { STATIC(MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.staticTable")), DYNA(MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.dynaTable")), DYNATOTLINE(""); private String name; private TotTableType(String name) { this.name = name; } //v2. 5.static final 필드 변조 가능성 : Update by KWON,HAN //private는 같은 클래스 내에서만 호출이 가능하므로 접근제한이 없는 public으로 하고 final을 사용하지 않는다. // public static final TotTableType asType(int typeNum) { public static TotTableType asType(int typeNum) { //LOG.debug("v2. 5.static final 필드 변조 가능성 : TotTable.asType() values()[typeNum]={}, Test OK", values()[typeNum]); return values()[typeNum]; } //========================================================== @Override public String toString() { return name; } } public TotTableType getType() { return this.type; } @Deprecated public void setType(TotTableType t) { this.type = t; } public int getItemSize() { return this.itemSize; } public void setItemSize(int size) { this.itemSize = size; } public String getForm() { return this.form; } @Deprecated public void setForm(String form) { this.form = form; } public String getTypes() { return this.types; } public void setTypes(String types) { this.types = types; } public MDept getOwnerParty(PersistenceManager pm) { return this.getTotDoc().getDept(pm).getRootDept(pm); } }