2 Replies Latest reply: Nov 9, 2012 12:57 PM by User757151-Oracle RSS

    isAttributeUpdateable ViewRowImpl Override based on Entity

    User757151-Oracle
      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
          Alejandro Profet
          Hi,

          Try this:
          String attrName = getAttributeNames();


          AP
          • 2. Re: isAttributeUpdateable ViewRowImpl Override based on Entity
            User757151-Oracle
            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();