114 lines
2.6 KiB
Plaintext
Executable File
114 lines
2.6 KiB
Plaintext
Executable File
package com.fp.dto;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* Clase a extender en los entity beans, que manejan el mapeo de objetos con la base de datos relacional.
|
|
*
|
|
* @author Jorge Vaca .
|
|
* @version 2.1
|
|
*/
|
|
public abstract class AbstractDataTransport implements Serializable, Cloneable {
|
|
|
|
/** Version de la clase. */
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/**
|
|
* HashCode asociado con la Instancia.
|
|
*/
|
|
private int rowkey = 0;
|
|
|
|
public HashMap<String, Object> modifiedData = new HashMap<String, Object>();
|
|
|
|
/**
|
|
* Indica que el registro es nuevo.
|
|
*/
|
|
public boolean isnew = false;
|
|
|
|
/** Indica que el registro se actualiza en la base de datos en save generico. */
|
|
public boolean isupdated = false;
|
|
|
|
public abstract Object cloneMe() throws CloneNotSupportedException;
|
|
|
|
/**
|
|
* Implementacion del metodo rowkey del registro.
|
|
*
|
|
* @return el hashCode la instancia
|
|
*/
|
|
public final int rowkey() {
|
|
if (rowkey == 0) {
|
|
rowkey = (int) (Math.random() * 10000000);
|
|
}
|
|
return rowkey;
|
|
}
|
|
|
|
// private boolean modified = false;
|
|
|
|
public Map<String, Object> modifiedData() {
|
|
return modifiedData;
|
|
}
|
|
|
|
public Object get(String key) {
|
|
return modifiedData.get(key);
|
|
}
|
|
|
|
public void put(String pField, Object pData) {
|
|
modifiedData.put(pField, pData);
|
|
}
|
|
|
|
public void addAddtionalInfo(String pName, Object pValue) {
|
|
modifiedData.put(pName, pValue);
|
|
}
|
|
|
|
public HashMap<String, Object> getModifiedData() {
|
|
return modifiedData;
|
|
}
|
|
|
|
public void setModifiedData(HashMap<String, Object> modifiedData) {
|
|
this.modifiedData = modifiedData;
|
|
}
|
|
|
|
public String getTransportBeanClass() {
|
|
return this.getClass().getCanonicalName();
|
|
}
|
|
|
|
/**
|
|
* Entrega el valor de: rowkey
|
|
*
|
|
* @return int
|
|
*/
|
|
public int getRowkey() {
|
|
return rowkey;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de: rowkey
|
|
*
|
|
* @param Valor a fijar en el atributo.
|
|
*/
|
|
public void setRowkey(int rowkey) {
|
|
this.rowkey = rowkey;
|
|
}
|
|
|
|
/**
|
|
* Entrega el valor de: isnew
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public boolean isIsnew() {
|
|
return isnew;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de: isnew
|
|
*
|
|
* @param Valor a fijar en el atributo
|
|
*/
|
|
public void setIsnew(boolean isnew) {
|
|
this.isnew = isnew;
|
|
}
|
|
|
|
}
|