package model.entity;
import oracle.jbo.Key;
import oracle.jbo.RowIterator;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.EntityDefImpl;
import oracle.jbo.server.EntityImpl;
// ---------------------------------------------------------------------
// --- File generated by Oracle ADF Business Components Design Time.
// --- Mon Aug 19 12:03:06 CST 2013
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class SuppliersEOImpl extends EntityImpl {
public void lock() {
//super.lock();
}
protected StringBuffer buildDMLStatement(int i, AttributeDefImpl[] attributeDefImpl,
AttributeDefImpl[] attributeDefImpl2,
AttributeDefImpl[] attributeDefImpl3, boolean b) {
StringBuffer stmt = super.buildDMLStatement(i, attributeDefImpl, attributeDefImpl2, attributeDefImpl3, b);
if (i == DML_UPDATE) {
// Get the alias name (it is equal to the entity definition name)
String alias = this.getEntityDef().getDefName();
// Remove the alias from the UPDATE statement
int index = stmt.indexOf( " " + alias + " SET ");
if (index != -1)
stmt = stmt.replace( index, index + alias.length() + 1, "");
}
return stmt;
}
/**
* AttributesEnum: generated enum for identifying attributes and accessors. Do not modify.
*/
public enum AttributesEnum {
SupId {
public Object get(SuppliersEOImpl obj) {
return obj.getSupId();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setSupId((Integer)value);
}
}
,
SupName {
public Object get(SuppliersEOImpl obj) {
return obj.getSupName();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setSupName((String)value);
}
}
,
Street {
public Object get(SuppliersEOImpl obj) {
return obj.getStreet();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setStreet((String)value);
}
}
,
City {
public Object get(SuppliersEOImpl obj) {
return obj.getCity();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setCity((String)value);
}
}
,
State {
public Object get(SuppliersEOImpl obj) {
return obj.getState();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setState((String)value);
}
}
,
Zip {
public Object get(SuppliersEOImpl obj) {
return obj.getZip();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setZip((String)value);
}
}
,
CoffeesEO {
public Object get(SuppliersEOImpl obj) {
return obj.getCoffeesEO();
}
public void put(SuppliersEOImpl obj, Object value) {
obj.setAttributeInternal(index(), value);
}
}
;
private static AttributesEnum[] vals = null;
private static int firstIndex = 0;
public abstract Object get(SuppliersEOImpl object);
public abstract void put(SuppliersEOImpl object, Object value);
public int index() {
return AttributesEnum.firstIndex() + ordinal();
}
public static int firstIndex() {
return firstIndex;
}
public static int count() {
return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
}
public static AttributesEnum[] staticValues() {
if (vals == null) {
vals = AttributesEnum.values();
}
return vals;
}
}
public static final int SUPID = AttributesEnum.SupId.index();
public static final int SUPNAME = AttributesEnum.SupName.index();
public static final int STREET = AttributesEnum.Street.index();
public static final int CITY = AttributesEnum.City.index();
public static final int STATE = AttributesEnum.State.index();
public static final int ZIP = AttributesEnum.Zip.index();
public static final int COFFEESEO = AttributesEnum.CoffeesEO.index();
/**
* This is the default constructor (do not remove).
*/
public SuppliersEOImpl() {
}
/**
* @return the definition object for this instance class.
*/
public static synchronized EntityDefImpl getDefinitionObject() {
return EntityDefImpl.findDefObject("model.entity.SuppliersEO");
}
/**
* Gets the attribute value for SupId, using the alias name SupId.
* @return the value of SupId
*/
public Integer getSupId() {
return (Integer)getAttributeInternal(SUPID);
}
/**
* Sets <code>value</code> as the attribute value for SupId.
* @param value value to set the SupId
*/
public void setSupId(Integer value) {
setAttributeInternal(SUPID, value);
}
/**
* Gets the attribute value for SupName, using the alias name SupName.
* @return the value of SupName
*/
public String getSupName() {
return (String)getAttributeInternal(SUPNAME);
}
/**
* Sets <code>value</code> as the attribute value for SupName.
* @param value value to set the SupName
*/
public void setSupName(String value) {
setAttributeInternal(SUPNAME, value);
}
/**
* Gets the attribute value for Street, using the alias name Street.
* @return the value of Street
*/
public String getStreet() {
return (String)getAttributeInternal(STREET);
}
/**
* Sets <code>value</code> as the attribute value for Street.
* @param value value to set the Street
*/
public void setStreet(String value) {
setAttributeInternal(STREET, value);
}
/**
* Gets the attribute value for City, using the alias name City.
* @return the value of City
*/
public String getCity() {
return (String)getAttributeInternal(CITY);
}
/**
* Sets <code>value</code> as the attribute value for City.
* @param value value to set the City
*/
public void setCity(String value) {
setAttributeInternal(CITY, value);
}
/**
* Gets the attribute value for State, using the alias name State.
* @return the value of State
*/
public String getState() {
return (String)getAttributeInternal(STATE);
}
/**
* Sets <code>value</code> as the attribute value for State.
* @param value value to set the State
*/
public void setState(String value) {
setAttributeInternal(STATE, value);
}
/**
* Gets the attribute value for Zip, using the alias name Zip.
* @return the value of Zip
*/
public String getZip() {
return (String)getAttributeInternal(ZIP);
}
/**
* Sets <code>value</code> as the attribute value for Zip.
* @param value value to set the Zip
*/
public void setZip(String value) {
setAttributeInternal(ZIP, value);
}
/**
* getAttrInvokeAccessor: generated method. Do not modify.
* @param index the index identifying the attribute
* @param attrDef the attribute
* @return the attribute value
* @throws Exception
*/
protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
}
return super.getAttrInvokeAccessor(index, attrDef);
}
/**
* setAttrInvokeAccessor: generated method. Do not modify.
* @param index the index identifying the attribute
* @param value the value to assign to the attribute
* @param attrDef the attribute
* @throws Exception
*/
protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {
if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);
return;
}
super.setAttrInvokeAccessor(index, value, attrDef);
}
/**
* @return the associated entity oracle.jbo.RowIterator.
*/
public RowIterator getCoffeesEO() {
return (RowIterator)getAttributeInternal(COFFEESEO);
}
/**
* @param supId key constituent
* @return a Key object based on given key constituents.
*/
public static Key createPrimaryKey(Integer supId) {
return new Key(new Object[]{supId});
}
}