java code for writing the fields of one table as colums to another table and storing the data in another table as a single row only

37 views
Skip to first unread message

hemant...@gmail.com

unread,
Jun 11, 2014, 11:42:47 AM6/11/14
to open...@googlegroups.com
After the user is logining to the application, there is a tab called user management,in that clicking on create user link.It will display New Create User Form with all the fields(Example we will take 2 fields for firstname,gender etc..).
After filling all the details and clicking the 'Save' button. The data is getting stored in 'o_userproperty' table with key-value pairs and has fields like 'first-name and gender' etc. 

see the screen shot-1
I had created another table 'o_userproperty_dummy' which has the column names as'first-name' and 'gender'
But Remember,'first-name and 'gender' are the fields of 'o_userproperty' table.

So my issue is I want to write a java code and hbm files 
where while filling the create user form of'first-name' and 'gender'.The same details should also be stored in 'o_userproperty_dummy'table with row wise i.e. forieng_key , Firstname and Gender with values .

see the screen shot -2
My concern is that we need to save in 1 row only in the o_userproperty_dummy table..as shown in
screen-shot3.
 
So can you please tell me in which java files and hibernate files i need to make changes.So i can store the only single row records in o_userproperty_dummy for columns 'first-name' and 'gender'

Please go through the attached screenshots for your reference.
Thanks in advance.

Regards,
Hemant
screen-shot3.png
screen-shot1.png
screen-shot2.png

Florian Gnägi

unread,
Jun 16, 2014, 7:35:21 AM6/16/14
to open...@googlegroups.com
Hi Hermant

Sorry, but I don’t quite understand what you want to achieve. 

It seems to me you are looking for a way to implement something like a reduced view of the o_properties table. Use the database view construct to do this and don’t store the data twice in the database. See the manual of your database how to create and query views. 

Cheers
Florian

--
--
Sie erhalten diese Nachricht, weil Sie Mitglied sind von Google
Groups-Gruppe "OpenOLAT".
Für das Erstellen von Beiträgen in dieser Gruppe senden Sie eine E-Mail
an open...@googlegroups.com
Um sich von dieser Gruppe abzumelden, senden Sie eine E-Mail an
openolat+u...@googlegroups.com
Weitere Optionen finden Sie in dieser Gruppe unter
http://groups.google.com/group/openolat?hl=de
-------------------------------------------------------------------------------------------------------------------
OpenOLAT - infinite learning - http://www.openolat.org

---
You received this message because you are subscribed to the Google Groups "OpenOLAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openolat+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<screen-shot3.png><screen-shot1.png><screen-shot2.png>

--------------------------------------------------------------------
professional services for the e-learning system OpenOLAT and OLATpro
 hosting - operating - support - development - mobile - consulting
--------------------------------------------------------------------

frentix  GmbH
Florian Gnägi, Geschäftsführer
Hardturmstrasse 76
CH-8005 Zürich, Switzerland

skype:gnaegi  twitter:gnaegi  xing:Florian_Gnaegi 
--------------------------------------------------------------------















Reply all
Reply to author
Forward
0 new messages