This discussion is archived
2 Replies Latest reply: Nov 9, 2012 10:57 AM by user757151 RSS

isAttributeUpdateable ViewRowImpl Override based on Entity

user757151 Newbie
Currently Being Moderated
I need to override isAttributeUpdateable in ViewRowImpl. This is for a view object that joins a few tables. The override must disable an attribute based on 2 conditions - the value of another attribute AND the whether attribute's entity object is named "Employees".

My question is this: isAttributeUpdatable takes the index of the attribute. Using that index, how does one get the name of the attribute's underlying entity object.

here is pseudo-code that represents the required override - the third line is what I am stuck upon:

<pre>
public boolean isAttributeUpdatable(int index) {
String statusAttr = this.getStatus();
String attrEntityName = <i><function call(s) to get the name of the entity's attribute></i>;
if(statusAttr.equalsIgnoreCase("PENDING") && attrEntityName.equalsIgnoreCase("Employees")){
return false;
}
return super.isAttributeUpdatable(index);
}
</pre>


Am using 11g.

Thanks for your help.
  • 1. Re: isAttributeUpdateable ViewRowImpl Override based on Entity
    AlejandroProfet Journeyer
    Currently Being Moderated
    Hi,

    Try this:
    String attrName = getAttributeNames();


    AP
  • 2. Re: isAttributeUpdateable ViewRowImpl Override based on Entity
    user757151 Newbie
    Currently Being Moderated
    Thanks, but that just gets the attribute name.

    what i did find after playing arouond a bit is that this will get the entity name for the attribute:
                String attrName = getAttributeNames(); 
    //"this" is a ViewRowImpl
    EntityImpl entity = (EntityImpl)this.getEntityForAttribute(attrName);
    String entityName = entity.getStructureDef().getName();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points