How to assign a transient value as a default value to another attribute in View Object - ADF

試著忘記壹切 提交于 2019-12-25 01:28:04

问题


I am new to adf and I am trying to provide a default value based on an sql statement to another attribute. For instance I have a table called Employee(emp_id,emp_version,emp_name...), which has a column emp_version and i want to provide a default value to emp_version with the following sql statement:

  select count(emp_id)+1
    from employees

In order to do this I tried to create a transient field(testEmpversionTransient) and provide an sql statement as shown below:

However I am not able to assign the value from the testEmpversionTransient attribute to emp_version attribute, any idea how it can be acheived please?

Thanks in advance


回答1:


Youre trying something like adding a default value to a certain field when entering data to your table right.

For that you don't need to change the SQL statement, all you have to do is adding the default value to the required field's placeHolder (located in the properties tab of that field)

placeholder="Default Value"

When you commit the changes to the Data Base, for that field the default value will be commited.



来源:https://stackoverflow.com/questions/48135583/how-to-assign-a-transient-value-as-a-default-value-to-another-attribute-in-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!