I’m considering using hibernate to access an existing postgresql-database. To access the database via username and password is of course a standard-procedure.
But due to an additional security layer within the database it is necessary to start every transaction with a select-statement and specific parameters (username and password or a session-token of the web application) Otherwise all following queries or DML statements won't be executed.
For example:
Quote:
BEGIN
//required select statement as a kind of login
select * from session_login_web ( username, password, additional information)
//all other queries or DML statements
insert into…
COMMIT / END
The select statement (with username / password or session-token) at the beginning of every transaction is necessary to authorize the “user” within the database. After a successful authorization, all data is queried and manipulated via views!
Are there any possibilities to use hibernate for these special purposes, to force hibernate executing the select-statement for each transaction and to query and manipulate views instead of tables?