在 Oracle ADF 中填充瞬态属性的 java 代码 [英] java code to populate an transient attribute in Oracle ADF

查看:46
本文介绍了在 Oracle ADF 中填充瞬态属性的 java 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Oracle ADF 非常陌生.

I very new to Oracle ADF.

我创建了一个视图对象,它有一个瞬态属性.(选择文字并且不提供任何值.)现在我想使用 Java 类中相同视图对象的另一列(存在一些业务计算)来填充该列.知道哪个班级或我怎么做吗?

I have created a view object and it has a transient attribute. (Select literal and provided no value.) Now I want to populate the column using another column of the same viewobject(some business calculations are there) from a Java class. Any idea which class or how I can do that?

我必须编写逻辑的是 rowImpl 类吗?如果有,能举个例子吗?

Is it rowImpl class that I have to write my logic? If so can you give an example?

这是我想要创建的示例.在 Hr 模式中,我们有 Department 和 Employees 表,喜欢外键关系.

here is an example of what I am looking to create. in Hr schema we have Department and Employees table liked with foreign key relationship.

部门名称 Noofemployees 百分比

人力资源 2 10.52631579管理员 8 42.10526316工程师 9 47.36842105总计 19 100

HR 2 10.52631579 Admin 8 42.10526316 Engineer 9 47.36842105 Grand totatal 19 100

这里的百分比是我的瞬态属性.所以值是 2/19*100 OR 8/19*100 等

here percentage is my transient attribute. So value is 2/19*100 OR 8/19*100 ,etc

推荐答案

为什么不考虑使用 Groovy 来计算瞬态属性的值,方法是将其设置为表达式",然后编写一个 Groovy 表达式来引用相同的其他属性VO.使用 Groovy 白皮书网络研讨会示例文档

Why not consider Groovy for calculating the value of the transient attribute by setting it to "expression" then writing a Groovy expression to refer to the other attributes in the same VO. Using Groovy Whitepaper Webinar Sample Docs

这篇关于在 Oracle ADF 中填充瞬态属性的 java 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆