Skip to main content

A public API to get the value originally read for an Entity Attribute from the database

There is an 'undocumented and smart' API to get get the value originally read for an Entity Attribute from the database. Thanks to Steve for sharing this. You may need to call EntityImpl::getAttribute(attrIndex,EntityImpl.ORIGINAL_VERSION) to get the original value of the attribute.

As you may be aware, there is a 'well known' protected method EntityImpl::getPostedAttribute(int index) also available for the same purpose. In this case, you may need to sub class the EntityImpl
to increase the visibility, if you want to use it in your business service implementation.

Comments

Sergio M said…
Hi Jobinesh.

I know that this post is old but I ended up here finding information about this issue. My problem it's that I can't get the old value from a Clob attribute.

Originally I tried with the same code as in other type of fields:
getPostedAttribute(i);
getAttribute(i);

After seeing your post I tried this:
getAttribute(i, EntityImpl.ORIGINAL_VERSION); getAttribute(i, EntityImpl.CURRENT_VERSION);

In both cases the new value and the old value are the same value, corresponding with the new value, is there any way to get the old value from a CLOB attribute?

Thanks in advance.
Sergio M said…
I forgot to add, I'm doing this from a extended class of oracle.jbo.server.EntityImpl in the doDML method.

Popular posts from this blog

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!