Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
jvx:server:storage:insteadof [2020/06/15 12:13]
cduncan Edited for English grammar (capitalization, punctuation, correct verb conjugation)
jvx:server:storage:insteadof [2024/11/18 10:23] (current)
admin
Line 2: Line 2:
 ~~Title: InsteadOf Trigger~~ ~~Title: InsteadOf Trigger~~
  
-If you're an Oracle user, you'll know that it's possible to update views with insteadOf triggers. An insteadOf trigger will do the CRUD operation(s),​ and it will be called with new/changed values like any other trigger. It's like a procedure ​which does CRUD programatically. It's a simple concept but not available in all databases.+If you're an Oracle user, you'll know that it's possible to update views with insteadOf triggers. An insteadOf trigger will do the CRUD operation(s),​ and it will be called with new/changed values like any other trigger. It's like a procedure ​that does CRUD programatically. It's a simple concept but not available in all databases.
  
-With JVx' DBStorage it's super easy to use insteadOf triggers in your business logic independent of the database.+With JVx' DBStorageit's super easy to use insteadOf triggers in your business logic independent of the database.
  
 We have a short example for you. Imagine you have an activity table with columns: name, cost, valid_from, valid_to, etc. The table also has a foreign key to a contract. One contract has one or more activities: We have a short example for you. Imagine you have an activity table with columns: name, cost, valid_from, valid_to, etc. The table also has a foreign key to a contract. One contract has one or more activities:
Line 16: Line 16:
 We'll use an insteadOf trigger to solve this problem. We'll use an insteadOf trigger to solve this problem.
  
-In above screenshot, the "New contract"​ wasn't available in the contract table, but we did the insert during inserting a new activity. Here's the whole code:+In the above screenshot, the "New contract"​ wasn't available in the contract table, but we did the insert during inserting a new activity. Here's the whole code:
  
 <file java TestInsteadOf.java>​ <file java TestInsteadOf.java>​
Line 41: Line 41:
 package com.sibvisions.forum;​ package com.sibvisions.forum;​
  
-import ​javax.rad.application.SimpleTestLauncher;​ +import ​jvx.rad.application.SimpleTestLauncher;​ 
-import ​javax.rad.genui.UIFactoryManager;​ +import ​jvx.rad.genui.UIFactoryManager;​ 
-import ​javax.rad.genui.container.UIPanel;​ +import ​jvx.rad.genui.container.UIPanel;​ 
-import ​javax.rad.genui.layout.UIBorderLayout;​ +import ​jvx.rad.genui.layout.UIBorderLayout;​ 
-import ​javax.rad.type.bean.IBean;​ +import ​jvx.rad.type.bean.IBean;​ 
-import ​javax.rad.ui.celleditor.ILinkedCellEditor;​+import ​jvx.rad.ui.celleditor.ILinkedCellEditor;​
  
 import org.junit.Before;​ import org.junit.Before;​
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information