I have looked through the documentation and searched the forums, but i can't seem to find an answer to this question. So here goes:
If I have a table with the following columns:
id - int
First name - string
last name - string
misc - string
Ifi map a POJO to this table, but only the id, first name and last name columns are mapped. When an update occurs, does Hibernate delete the data in the misc column, or will it simply ignore it?
The basic gist is, i have tables that have 30+ columns on them. however my app will only need to update maybe 10 or so. The data in the other columns needs to stick around. Do i have to map these columns to ensure that an update doesn't wipe out the data. Or if i don't map them, will the Hibernate persistence manager simply treat them as if they weren't there?
All of the examples and other classes i've used, have a 1:1 property-to-column mapping. So when i see the logging of the updates/inserts, i see all of the columns on the table in the SQL statement. I would assume that if i don't map the column, then the insert/update statement doesn't contain that column its list for updates, nor a NULL in the value set in the corresponding location.
Unfortunately I don't have permissions to create some test tables in the database, otherwise i'd just try that. I am hoping that someone could simply provide a "yes/no" and a short explanation. Thanks in advance!
-B
|