You might want to make your objects immutable.. in the <Class> element set the mutable attribute to false. Also check out
http://www.hibernate.org/h
Read the section (6.1.4. id)
Also right above this section:
There is no difference between a view and a base table for a Hibernate mapping, as expected this is transparent at the database level (note that some DBMS don't support views properly, especially with updates). Sometimes you want to use a view, but can't create one in the database (ie. with a legacy schema). In this case, you can map an immutable and read-only entity to a given SQL subselect expression...
Main Topics
Browse All Topics





by: actonwangPosted on 2005-10-07 at 08:53:50ID: 15039764
simply set it as <id name="<your name>" type="string<or other type>" />
Hibernate will treat view as table except you don't do insert and update on that in the program.