How Can implement the audit function using toplink?
My system must record all the modification, how can I use toplink to implement it.
I know when toplink modify some object, the toplink will check how many attribute
have been modified, and then update it to database, Can I implement the record when
the toplink check modification?
PS: I dont want to use database trigger.
Thank first!!
This thread has been inactive for a while, so perhaps I'm missing something. I am attempting to create audit events on domain objects using a TopLink 10.1.3 DescriptorEventAdapter.
These audit events mutate or create a snapshot collection on the domain object. Based on what I understand from the above thread, do I still need to create another UoW to commit these in my preInsert()/preCreate() handler methods?
Is there a way to get in the game before the IDs are assigned to the objects and the change set is computed?
I certainly don't claim to fully understand the historical client session docs. However, one of our requirements is to show object-attribute-level deltas (list chronologically, grouped by transaction, the attributes that have changed, who changed them, etc. with their before and after values). So my first-blush reaction is that it's easier to utilize the change set to create a collection of transactionally-grouped audit objects on the domain.
Thanks much,
--Todd Fredrich
Similar Messages
-
How to implement the pessimistic locking using toplink with sybase
we want to allocate the unique primary key to each row when many user try to insert the records concurrently..So what we are trying to do is we calculate the maximum of Primary Key and incremented it by 1. Now we want to Apply the locking concept on the so that unique key will be allocated to each newly inserted row
Can you please tell me
1. how we can genrate unique primary key in toplink using sybase?
2.how to implement the pessimistic or optimistic locking ?which one will be preferable?Hi brother
I think that this link can help you
http://download-east.oracle.com/docs/cd/A97688_16/toplink.903/b10064/database.htm#1007986
Good luck -
In one sequence I have dozens of Pre-Expressions which are almost the same thing, like this...
Locals.tagID = (Parameters.singlePhaseEnabled ? "L" : "D") & Str(Locals.phase) & "006"
...and the only thing different is that three digit string at the end ("006" will vary). How can I write a function that I can call from a step's Pre-Expression so it would look something like this? ...
Locals.tagID = MyNewFunction("006")You cannot write custom commands for expressions.
That being said, there are a couple of options:
Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
Norbert -
How to implement a callback function using LabView's Call Library Function Node?
I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
me and I do not have the source code, just the .dll and .h files.
The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
this one out. I am using LabView 8.6.
The SDK.h deacribes the function as:
// Function: SdkSetPropertyEventHandler
SdkError SDKAPI SdkSetPropertyEventHandler(
SdkCameraRef inCameraRef,
SdkPropertyEvent inEvnet,
SdkPropertyEventHandler inPropertyEventHandler,
SdkVoid* inContext );
// Description:
// Registers a callback function for receiving status
// change notification events for property states on a camera.
// Parameters:
// In: inCameraRef - Designate the camera object.
// inEvent - Designate one or all events to be supplemented.
// inPropertyEventHandler - Designate the pointer to the callback
// function for receiving property-related camera events.
// inContext - Designate application information to be passed by
// means of the callback function. Any data needed for
// your application can be passed.
// Out: None
// Returns: Any of the sdk errors.
A separate header file called SDKTypes.h contains the following data:
typedef SdkUInt32 SdkPropertyEvent;
typedef SdkUInt32 SdkPropertyID;
typedef void SdkVoid;
typedef struct __SdkObject* SdkBaseRef;
typedef SdkBaseRef SdkCameraRef;
SdkPropertyEventHandler
typedef SdkError ( SDKCALLBACK *SdkPropertyEventHandler )(
SdkPropertyEvent inEvent,
SdkPropertyID inPropertyID,
SdkUInt32 inParam,
SdkVoid * inContext );
Thanks for your help.
Alejandro
Solved!
Go to Solution.alejandroandreatta wrote:
I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
me and I do not have the source code, just the .dll and .h files.
The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
this one out. I am using LabView 8.6.
Basically you do not do that. LabVIEW does not know pointers and certainly not function pointers. What you should do instead is writing a C DLL that implements the callback and also exports a function to be called by LabVIEW that translates between the callback and a LabVIEW user event. Look for PostLVUserEvent() here on the NI site to find examples how to do that.
Rolf Kalbermatter
Message Edited by rolfk on 02-11-2009 08:00 PM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
How to implement the Transfer Function in Real Time VIs?
Hi all,
I'm relatively new to Labview Real Time modoule and want to implement one Controller(not PID one) in Deterministic Loop! I have already designed discrete Transfer Function and searching for the way to build one Controller with it! Is it right to use the Simulation Loop instead of Timed Loop (in this case Deterministic loop) and implement the controller in it?! If it's correct so, should I use the same clock and Priod as Timed Loop?!
It would be very helpful, if there is an Example about using transfer function in Real Time Loops!
thanks for your help,
MohsenHello mhmdi,
Sorry I can't open your VI (looks like it is a new version of LV than I have installed).
You're right - you don't need to convert to a difference equation if you have the CD&SIM Module which can take discrete time transfer functions directly. You don't need shift registers with this function, as it is effectively done internally. If you don't have CD&SIM discrete TF's can be implemented easily just in a timed (or while) loop with feedback nodes or shift registers to replicate each z-1 you need.
Some more ideas:
There are many configuration parameters and options with the Discrete TF VI - which you need to understand for your application and make sure are correct. Sometimes implementing in a basic form (timed loop and shift registers) allows you to see what is happening without any confusing options you might not need.
Are you using the Discrete TF VI in a Simulation Loop ? You might need to think if the loop being used is appropriate for a Real Time application. Maybe the timing of the TF, the loop and the DAQmx data are not all suitable for each other.
I'm not familar with DAQmx, so not sure about any specific real-time aspetcs of that.
"if the sample frequency of the discrete transfer function in the timed-loop is at multiple integers of the sampling rate (e.g. 12000 Hz for tranfer function and 4000 Hz for sampling rate, 12000=3*4000), would it somehow improve the resolution of the controller command?"
This could actually make things worse - but depends on your transfer function if it is a problem. Think about it this way - in the scenario you state the input signal going into the Discrete TF will only change once in every three samples, that means if your transfer function includes a 1-z^(-1) factor (i.e. a derivative) - that will be zero for two samples then jump up for the next sample. You'll observe a very jittery/noisy signal, but the noise is due to samples not being correct. This will also occur if the sample times are very similar but go in and out of sync where you may get the occassional sample that is the same and hence the occassional zero in the TF.
In an application I had we had problems trying to get the data coming into a timed loop and the timed loop itself synchronise, and before it was fixed the control signal was very jittery.
Consultant Control Engineer
www-isc-ltd.com -
How to implement Excel like functionality using Table?
I have a requirement to implement excel like functionality in a table, i.e when I update the amount in the first row and tab out, the values in the rows below should get affected.
Could any one suggest idea how to get this done?Hi Timo,
Thanks for your Reply.
Can you please provide the code for capturing the key stroke in java script and queue it in the server and calling only the adf data table values from it.
Thanks And Regards,
Lovenish Garg
Edited by: lovenish on 21-Jan-2011 04:25 -
How to Implement the same functionality of IT1610 and IT1641 for CANADA
Hi experts,
We have done HCM Implementation to US and now moving to CANADA. We got the requirement to create two custom OM infotypes which are similar of IT1610 and IT1641 in US specific. But when I check the functionality of IT1610, it is maitaining by calling a view T5U13. It looks like some complex logic is there behind the screen. I am able to create basic custom infotype but not able to implement the logic to calla a view (T5K13 in CANADA) through PP01 or PO03 and then maintain the view as well as the infotype. How the view screen is embeded in creation of IT1610 screens.
Could you please help me on providing the solution for this?
Thanks for your time and waitaing for your valuable reply.
Regards,
JpHi Idrees,
You need two grids and at least 3 datatable.
Grid 1 bound to DataTable 1 - This will list all the Items, nothing special about this one.
Grid 2 bound to DataTable 2 - This will list selected batch for current selected Item in Grid 1.
DataTable3 - This will hold all the selected batches for all the items in Grid 1.
Now you need to refresh DataTable 2 based on the Selected item in DataTable 1.
When the user click on a row in DataTable 1, you need to do 2 things :
1. Read all the records of DataTable 2 and sync it to DataTable 3.
2. Read all the records of DataTable 3 where the Item Code belongs to the Item selected in Grid 1 populate it into DataTable2.
Tedious, but will do the job.
When the user click Add/Update button, write the records of DataTable1 and DataTable3 into database.
Regards
Edy -
How can query the table MARD using the parameters
Hi,
I have inputs as material number , sales organization , distribution chanel and plant , using this i have query the table MARD . in MARD table material number and plant is available , how can i relate sales organization and distribution chanel to query the table, please help.
Regards,
RatheeshHi,
MVKE table contains the relationship between material, sales org. and distribution channel.
You can hence create a join between MARD and MVKE tables and create a query.
Regards,
Aditya -
How to implement the RemoveLast function in a link list? check my code plz
Hi guys,
How to delete the last element in a user defined linklist. I am using the following code to find the last element of the list. It works fine, but i don't know how to remove that element ...
public Object getRear()
rear=front;
while (rear !=null)
if (rear.getNext()!=null)
rear=rear.getNext();
else
break; //rear Node found
if (rear !=null) //list is not empty
return rear.getData();
return null; //list is empty
}Sorry, I missed out on returning the last element:
public Object delRear() {
// I assume front is an instance field pointing to the first element
if(front != null) { // list contains something
Element rear, pred; // I assume you have some type like this
// determine predecessor of last element
rear = front;
pred = null;
while(rear.getNext() != null) {
pred = rear;
rear = rear.getNext();
if(pred == null) front = null; // delete only element
else pred.setNext(null); // delete last element
return rear; // return deleted element
else return null; -
How to implement this planning function using Fox formula
Hello,
I am new to Fox.
I want to implement this complex logic in a planning function
i have A (Kf X from infoprovider Z_A), B (Kf Y from infoprovider Z_B) & moreover there is one more condition,
If current FISCPER > variable value of FISCPER
KF Z = KF Z1 (from Cube C1)
Else KF Z = KF Z2 (from Cube C2).
for a particular calender week,
X = ( Y * Z ) / (summation of (Y * Z) for each week of the whole year)
I know it is complex.
but i have to implement this in a planning function.
The aggreagtion level is built on a multiprovider having A, B , C1 & C2.
Can someone help me out with the FOX formula for this? or is there any better way to do this.
Thanks johnHi Gerardo,
Thanks for that.
I have tried something similiar to it
DATA CHA_CALWEEK TYPE 0CALWEEK.
DATA CHA_COMP_CODE TYPE 0COMP_CODE.
DATA CHA_FISCPER TYPE 0FISCPER.
DATA VAR_PERIOD TYPE 0FISCPER.
DATA SUM_YEAR TYPE F.
DATA TEMP_D TYPE F.
DATA SUM_WEEK TYPE F.
CURRENCY IS LOCAL CURRENCY. FOR DATA SELECTION TO BE RIGHT, NECESSARY TO DERIVE FROM CC.
DATA UN_LOC_CURRCY TYPE 0LOC_CURRCY.
UN_LOC_CURRCY = VARV(Z_U_I100).
CHA_COMP_CODE = VARV(Z_U_I100).
To Calculate the D
VAR_PERIOD = VARV(Z_U_I010).
SUM_YEAR = 0.
TEMP_D =0.
IF CHA_FISCPER > VAR_PERIOD.
TEMP_D = {ZSA_BUD2X,CHA_COMP_CODE,CHA_FISCPER,YBUDG_01X,CHA_CALWEEK}.
FOREACH CHA_CALWEEK.
SUM_YEAR = SUM_YEAR + TEMP_D * {ZCREENTSV,CHA_COMP_CODE,CHA_FISCPER,ZIP_RREF1} .
ENDFOR.
ELSE.
TEMP_D = ({ZSAEXCUSV,CHA_COMP_CODE,CHA_FISCPER,YRT_C02X} - {ZCREENTSV,CHA_COMP_CODE,CHA_FISCPER,YRT_C02X}).
FOREACH CHA_CALWEEK.
SUM_YEAR = SUM_YEAR + TEMP_D * {ZIP_INDEX,CHA_COMP_CODE,CHA_FISCPER,ZIP_RREF1}) .
ENDFOR.
ENDIF.
But i am getting a syntax error
Formula error: } expected
Syntax error in row 21, column 20
i have marke line21 in bold. above.
I feel it is correct, still wonder why i am getting this error.
can you pls help ? -
How to implement a back functionally like the back of the browser
Hi, I have a commandImageLink("go back") in a template jspx. How to implement the back functionally like the back of the browser with a managed bean method??. For know I m not using task flows.
I think you can use a javascript method to go back to the previous browser page.
http://javascript.about.com/library/blback.htm
http://www.pageresource.com/jscript/jhist.htm
http://www.w3schools.com/jsref/met_his_back.asp
Perhaps you find something useful and related to backing beans here:
http://adfdevelopers.blogspot.com/2009/04/some-handy-code-for-backing-beans-adf.html
NA
http://nickaiva.blogspot.com -
How to implement Master-Detail Search in TopLink without using DataControl
Hi,
I am using TopLink and EJB in our requirement. But we are not creating any data controls. Without data controls how to implement master detail search using TopLink and EJB. I did search for a single table. It is working fine. The way i implented is as follows.
1) Taking search parameter from UI and passing it to A delegator class's method.
2) Delegator class's method calls the EJB's NamedQuery which i already created using expression builder.
3) EJB executes the NamedQuery with the parameter we are passing. And it returns the results back to UI.
But as i am new to TopLink, can anyone tell me the procedure to implement Master - Detail search. Here we need to search based on Master table's column.
Waiting for the replies regarding this.
Thanks & Regards,
Suresh KethireddyHi,
I did it successfully. Following is the code.
Session session = getSessionFactory().acquireSession();
UnitOfWork uow = session.acquireUnitOfWork();
ReadAllQuery raq = new ReadAllQuery();
Dept d = new Dept();
d.setLoc(loc);
raq.setExampleObject(d);
List<Dept> res=(List<Dept>)uow.executeQuery(raq);
for(int i=0; i<res.size();i++){
System.out.println("Dept DeptNo ---"+res.get(i).getDeptno());
System.out.println("Dept DeptName ---"+res.get(i).getDname());
System.out.println("Dept Location ---"+res.get(i).getLoc());
List<Emp> eRes=res.get(i).getEmpCollection();
for(int j=0; j<eRes.size();j++){
System.out.println(" Emp No ---"+eRes.get(j).getEmpno());
System.out.println(" Emp Name ---"+eRes.get(j).getEname());
System.out.println("Emp HireDate ---"+eRes.get(j).getHiredate());
System.out.println(" Emp Job ---"+eRes.get(j).getJob());
System.out.println(" Emp Mgr ---"+eRes.get(j).getMgr());
System.out.println(" Emp Sal ---"+eRes.get(j).getSal());
But now my question is, i want to search by providing Dept param as well Emp(Which is child table) param also. Is it possible?
I tried in 2 ways like this.
1) Emp emp = new Emp();
emp.setEname(eName);
dept.addEmp(emp);
raq.setExampleObject(dept);
2) Emp e = new Emp();
e.setEname("ADAMS");
List<Emp> list = new ArrayList();
list.add(e);
d.setEmpCollection(list);
raq.setExampleObject(d);
But in both cases i failed to search based on the values i am passing to Emp.
Is there any other way to achieve my requirement?
Any help on this is great.
Thanks & Regards,
Suresh K -
How can I have both functions "Read Only" & "Write" mode on the same form?
Dear all,
How can I have both functions "Read Only" & "Write" mode on the same form? Is it possibile for this?
Please advice,
AmyThis is what I use in some dialogs:
PROCEDURE SET_QUERY_ONLY IS
-- Procedure Set_query_only
-- Rend les blocks non modifiables --
-- Disable menus Insert/Delete/Clear --
-- Entree :
-- Sortie :
-- Ent/Sortie :
-- Creation : FD 10/2003
-- Modification :
LC$Block Varchar2(30) ;
BEGIN
Set_Menu_Item_Property('Edit.Insert', ENABLED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Edit.Remove', ENABLED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Edit.Clear', ENABLED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Action.Save', ENABLED, PROPERTY_FALSE ) ;
LC$Block := get_form_property( NAME_IN('System.Current_Form'), FIRST_BLOCK ) ;
-- Tous les blocs en Query only --
While LC$Block is not null Loop
Enable_Block( LC$Block, FALSE ) ;
LC$Block := get_block_property( LC$Block, NEXTBLOCK ) ;
End loop ;
END;
PROCEDURE ENABLE_BLOCK
PC$Block in Varchar2,
PB$Enable in Boolean Default TRUE
) IS
-- Procedure Enable_block
-- Rend le bloc Enable / Disable --
-- Entree : PC$Block (nom du bloc Forms)
-- : PB$Enable (TRUE ou FALSE)
-- Sortie :
-- Ent/Sortie :
-- Creation : FD 10/2003
-- Modification :
BEGIN
If PB$Enable Then
Set_Block_Property( PC$Block, INSERT_ALLOWED, PROPERTY_TRUE ) ;
Set_Block_Property( PC$Block, UPDATE_ALLOWED, PROPERTY_TRUE ) ;
Set_Block_Property( PC$Block, DELETE_ALLOWED, PROPERTY_TRUE ) ;
Set_Menu_Item_Property('Edit.Insert', ENABLED, PROPERTY_TRUE ) ;
Set_Menu_Item_Property('Edit.Remove', ENABLED, PROPERTY_TRUE ) ;
Set_Menu_Item_Property('Edit.Clear', ENABLED, PROPERTY_TRUE ) ;
Set_Menu_Item_Property('Action.Save', ENABLED, PROPERTY_TRUE ) ;
Else
Set_Block_Property( PC$Block, INSERT_ALLOWED, PROPERTY_FALSE ) ;
Set_Block_Property( PC$Block, UPDATE_ALLOWED, PROPERTY_FALSE ) ;
Set_Block_Property( PC$Block, DELETE_ALLOWED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Edit.Insert', ENABLED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Edit.Remove', ENABLED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Edit.Clear', ENABLED, PROPERTY_FALSE ) ;
Set_Menu_Item_Property('Action.Save', ENABLED, PROPERTY_FALSE ) ;
End if ;
END;Francois -
How to implement the barcode printing functionality working on the Prod.
Hi,
Can anyone help me "How to implement the barcode printing functionality working on the Prod".
Thanks
GangadharaCheck this link --> barcode
-
I have two Apple ID, how can I delete one and use the email address associates to the main one?
If you abandon one of the Apple IDs you will also basically be abandoning any content that you have acquired with that Apple ID. Content can only be updated and re-downloaded with the Apple ID that was used to buy it. Apple will not combine the content of Apple IDs and Apple will not transfer the content from one Apple ID to another Apple ID.
Maybe you are looking for
-
Mail indexing and lost sent mail
since yesterday, mail has been repeatedly indexing, always getting stuck on one particular email and taking over 1/2 an hour each time before allowing access to the program. Finally, I was able to run a search and delete the offending email before th
-
Nokia sync problems. E7.
I received the notification concerning the joining of Ovi sync with Nokia mail contacts so I signed up & tried synching my phone contacts with my Nokia email account, the problem is whenever I sync the contacts using the phone they don't update, all
-
I would like to disable the phone jack for my mac book pro, it is a disappointment that this feature is not currently accessible . Hopefully it will be added with the following os x system software up date. until then is there anyone that could help
-
CProject 4. 0 Document Approval Document Error
Hi All, We have the configuration that was working fine for Phase Approval in cProjects 4.0. I am having a look at it as we are getting <b>You can not begin approval without an approval document</b> error message on click of Begin Approval button
-
How does the Mail update automatically? As soon as you get a new mail? Or is it every minute?