Fellow ranchers
I would like to have your opinion on this problem.
I have a file which is to be imported into database.
The data is to be to be inserted in Table DATA_INSERT for eg.
The header varies with different database and this mapping is in DATA_MAPPING.
Now I am using hibernate to insert the record.
Let us assume file header is "Project Name"
Corresponding value for this is in DATA_MAPPING table so here it goes
TABLE_COLUMN_NAME HEADER_NAME
------------------ ------------
PROJ_NBR Project Name
This PROJ_NBR is column in DATA_INSERT.
Similarly the list goes for 170 columns(huge table)
The hibernate class is like
Class
DataInsert {
@PROJ_NBR
private
String projectNbr;
public setProjectNbr(String proj){
this.projectNbr=proj
}
public getProjectNbr(){
return projectNbr;
}
Now how will I come to know when I am reading file that this data is
for which column(it can vary from databases)
and which setter to call ?
Thanks