I'm working on a simple grails project and I was wondering if there is a way I can make changes to table and the changes are reflected in another table. I have several tables two of which are Inventory table and Movement table.

Inventory table stores information about assets such as User who owns the asset, while Movement table houses information about the movement of assets between users (e.g. when one user leaves the organization, the asset he owns is transferred to a new user). What I want to do is that if I enter a new record in the Movement table such as old_user and new_user, the change should be reflected in Inventory table as new_user.

How can I achieve that.??

package com.inventory

class Inventory {

	String inventoryID
	String code
	String description
	String serial_num
	Date purchase_date
	byte[] image
	Date record_date
	String remarks
	Type type 
	Brand brand 
	User user 

	static hasMany = [movements: Movement]
	//static mappedBy = [movementsByOldUser: 'oldUser', movementsByNewUser: 'newUser']

	String toString(){
		"$inventoryID, $type"
    static constraints = {
    	inventoryID blank: false, unique: true
    	code blank: false
    	description nullable: true, maxSize: 1000
    	serial_num blank: false
    	image nullable: true, maxSize: 1000000
    	remarks nullable: true, maxSize: 1000

    //def  beforeUpdate(){
    //	this.user = movementsByNewUser
package com.inventory

class Movement {

	User oldUser
	User newUser
	Inventory inventoryID
	Date movementDate
	User userResponsible
    String reason

	//static belongsTo = User

    static constraints = {
    	inventoryID blank: false
    	oldUser blank: false
    	newUser blank: false
    	userResponsible blank: false
        reason maxSize: 1000
package com.inventory

class User {

	String userID
	String fullName
	String position
	Department department 

	String toString(){

	static hasMany = [inventories: Inventory, movementsByOldUser: Movement, movementsByNewUser: Movement]
	static mappedBy = [movementsByOldUser: 'oldUser', movementsByNewUser: 'newUser']

	//def beforeInsert(){
	//	this.fullName = movementsByOldUser

	//def beforeUpdate(){
	//	this.fullName = movementsByNewUser

    static constraints = {
    	userID blank: false, unique: true
    	fullName blank: false