package h2o.dao.advanced;

import h2o.common.Tools;
import h2o.dao.colinfo.ColInfoUtil;
import org.apache.commons.lang.builder.ToStringBuilder;


/**
 * Created by zhangjianwei on 2017/7/1.
 */
public abstract class AbstractEntity<E extends AbstractEntity> {

    private final String _tableName;

    private final String _w;

    private final String[] _pks;


    public AbstractEntity(String w, String[] pks ) {
        this._tableName = ColInfoUtil.getTableName(this.getClass());
        this._w = w;
        this._pks = pks;
    }

    public AbstractEntity(String tableName, String w, String[] pks ) {
        this._tableName = tableName;
        this._w = w;
        this._pks = pks;
    }


    public E fill( Object bean ) {
        Tools.b.beanCopy( bean , this );
        return (E)this;
    }

    public <B> B toBean( B bean ) {
        return (B) Tools.b.beanCopy( this , bean );
    }


    public String getTableName() {
        return _tableName;
    }

    public String getW() {
        return _w;
    }

    public String[] getPks() {
        return _pks;
    }


    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }


}

@@ -917,17 +917,18 @@
 ring get
-T
+_t
 ableName
@@ -991,9 +991,10 @@
  get
-W
+_w
 () %7B
@@ -1047,9 +1047,10 @@
  get
-P
+_p
 ks()
@@ -1076,25 +1076,24 @@
 pks;%0A    %7D%0A%0A
-%0A
     @Overrid

修改getter名,以免冲突