java - PostgreSQL getSequence current value and pass to id -


I have a question that triggers functions / triggers in postgreSql. I follow the following 2 sections:

  Abstract public square person () {int personid; } The public class employee enhances the person () {int employeeid; }  

I have a sequence of "hibernitis"

So what do I want to achieve: By putting in employee I want to get the current value of Hibernate_centence and this is " Employed "so that the two IDs are equal.

then trigger:

  make the trigger equal before putting the employee removal process on the setid; The function should do this:  
  Make the function set () 'Update employee sets the numeric form of employee' = select currval (hibernate_sequence ) Where personid = select Currval (hibernate_sequence) 'language sql;  

But I do not know how to get it. Postgresc doku I am not clear at this point ...

You will need to do this in hibernation Not in PostgreSQL

Hibernate brings blocks of ID and caches them. So the value of postgre SQL for the value of hibernate_sequence is not using hibernate.

In addition, the employee is included in the employee , regardless of the person / Code> or any other, and there is no one (supported, secure, reliable) to hide the location

You want to do this in your hibernate argument.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -