How to create temporary tables in Hibernate?

purpose

  • Calling instructions CREATE TEMPORARY TABLEin Hibernate without using native SQL. This means using only the HQL or Hibernate API.
  • Saving objects to a temporary table.
  • Call a stored procedure that uses existing tables and a temporary table.
  • DROPtemporary table at the end. (I know this is not necessary, but I think it is a good habit to do this.)

Background

  • I am very familiar with SQL, but new to Hibernate.
  • I am forced to use Hibernate in a project because you know someone decided.
  • I am going to save a web form in an Oracle database.
  • The web form contains a table full of text fields (created by someone else), one in each cell.
  • When the user clicks , the values MUST be stored in one transaction. Save
  • The web form is backed up by a database view.
  • The database view is created from the database table using the EAV template. (This is done because the columns are dynamic.)
  • Each text field in a web form is modeled on a single line in the database table.
  • A web form display uses expressions SELECTin a view.
  • When updating a web form, the view uses expressions UPDATEthat trigger the INSTEAD OFview's trigger .
  • Only updated values โ€‹โ€‹are updated. There is an audit trail for each update.
  • - , . : (I) a 4, - (II), 5 (III), 2 -.

  • AJAX (jQuery) , .
  • , , .

  • Save, ( - , /, / ) () .
  • .
  • ( ).
  • .
  • - , .
  • .
  • .
  • .

?

+3
1

, , ... , CSV, - http://csvjdbc.sourceforge.net/.

, , - .

+1

Source: https://habr.com/ru/post/1755240/


All Articles