I\'m having problems using Hibernate and SQL Server 2008. When I try to save an object to database Hibernate throws this:
could not retrieve snapshot: com.my
Change the schema to dbo. In SQL Server, schema is a container in the database, not the database itself. This may be different in MySQL, but in this case, your schema should be dbo (based on your comment about it working if you add "dbo." to your resultant query.
Thanks, Eric
So is there any other Hibernate configuration I need to make?
With your current setup, I guess you'll have to specify the schema. For example, in the mapping:
<class name="Users" table="Users" schema="dbo" catalog="suiteaccess">
But you can also specify the default schema using the hibernate.default_schema
property (see 3.4. Optional configuration properties).
Just in case, you can create your own schema.
Put below configuration into mapping file. It resolved the Invalid object exception.
<class name="Users" table="databaseName.dbo.Users">
Change the above line into Mapping file. It should be work. Because Mssql server have default schema (dbo). That's why use the fully classified table name.