Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I put this code: "execute as login=user2" before each insert operation, on hibernate:
Java
Session session = getSession();
session.getTransaction().begin();
session.persist(o);//put here when execute a normal insert

session.getTransaction().commit();
Posted
Updated 16-Sep-10 18:36pm
v2

1 solution

Your object has got a login field? If yes, use some of the dynamic proxies available for Java and intercept the call to set this value.
 
Share this answer
 
Comments
Manuel Rodriguez Coria 17-Sep-10 1:21am    
i want use execute command http://msdn.microsoft.com/en-us/library/ms181362.aspx ...and dynamic proxies put values in this case for login?

thanks for the reply....

Manuel Rodriguez Coria
Tarija, Bolivia

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900