بسم الله الرحمن الرحيم
اللهم علمنا ما ينفعنا وانفعنا بما علمتنا يا رب العالمين
---------------
3.)In the attribute getter method:-
Date hireDate = (Date)getAttributeInternal(HIREDATE);
// check for null and return today's date if needed
return (hireDate == null) ? (Date)Date.getCurrentDate() :
hireDate;
In this demo I am going to set default value of hire date of employees to today's date
There are 3 ways to set default values:-
1.) In the overridden create() method of the Entity object class:-
Generate EmployeesImpl.java class of EmployeesEO Entity Object.
Add the following code to create() immediately after the call to super.create() .
this.setHireDate((Date)Date.getCurrentDate());
There are 3 ways to set default values:-
1.) In the overridden create() method of the Entity object class:-
Generate EmployeesImpl.java class of EmployeesEO Entity Object.
Add the following code to create() immediately after the call to super.create() .
this.setHireDate((Date)Date.getCurrentDate());
2.) Declaratively using a Groovy expression:-
- Open the Employees Entity object and go to the Attributes page.
- Select the attribute HireDate.
- Select the Details tab.
- In the Default Value section, select Expression and enter the following Groovy
expression: adf.currentDate
3.)In the attribute getter method:-
- Go to getHireDate() method in the EmployeesImpl.java class.
- Replace the existing code in getHireDate() with the following:
Date hireDate = (Date)getAttributeInternal(HIREDATE);
// check for null and return today's date if needed
return (hireDate == null) ? (Date)Date.getCurrentDate() :
hireDate;
والسلام عليكم ورحمته الله وبركاته
<< سبحانك اللهم وبحمدك أشهد أن لا اله الا أنت أستغفرك وأتوب اليك >>
هل يمكن تعديل اليوم فقط فى التاريخ مثلا اخلى اى تاريخ يختاره يكون اساسى فيه انه اول يوم من الشهر اللى اختاره ايا كان
ReplyDeleteمحتاج اعمل التاريخ الهجرى يا باشمنهندس
ReplyDeleteمحتاج انزل التاريخ الهجرى على البرنامج بتاعى
ReplyDelete