Reputation: 23266
I have not tried it though, but it is possible to retrieve a data object
(or a row) that isn't saved by the hibernate
way (by the conventional session.commit() ) ?
I have a table in which the data is being saved by some another application, but I want to retrieve the data, modify if required and save it back using hibernate. Is it possible ?
Upvotes: 0
Views: 50
Reputation: 20112
Hibernate is just an access implementation independent from the used data. If your database schema does not change and the rows added into your tables fit to this schema (and the mapping from hibernate to the objects) you can retrieve these rows with hibernate, modify and save them back to the table, although they are not created with hibernate.
Upvotes: 0
Reputation: 9559
Yes you can, provided that the other process has committed its transaction. A Hibernate query will return whatever data matches the criteria in the query, however it got there.
Upvotes: 0
Reputation: 7863
The data in your database is independent from it's access mechanisms and tools. You can access the same database in a lot of ways as long as they are SQL conform. Hibernates session.commit()
is only one implementation of committing a transaction. I wouldn't call it "the hibernate way" but "hibernates way to do something the SQL way" ;-)
Upvotes: 2