-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Exclude Column
PostPosted: Tue Nov 25, 2003 3:02 pm 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:32 pm
Posts: 28
To whom it may concern,

If I have a table that I don't want to include all the columns in certain tables for example the guid column in the table that is required by SQL server for replication, is that any way in hibernate that I can exclude those columns. Thanks

Vivian


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 3:09 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
Just don't include the column in your hmb.xml files. You are not obliged to map all your db tables into a java bean property.

_________________
Mauricio Hern


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 3:10 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
Just don't map them.
If you don't tell Hibernate about them it won't know about them and it won't care. However, if any "ignored" columns have not null constraints then you would either have to have the database insert a default value or you would have to tell Hibernate about them.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 3:19 pm 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:32 pm
Posts: 28
Thank you very much.. Silly me.. :) :)


Top
 Profile  
 
 Post subject: SQL Server merge replication breaks database synchonisation
PostPosted: Tue Nov 23, 2004 2:38 pm 
Newbie

Joined: Tue Nov 23, 2004 2:15 pm
Posts: 1
Location: London
Hi, I'm having a similar issue caused by SQL Server merge replication. My application works perfectly until I configure the replication. As soon as I reload the app Hibernate throws the following error:

Code:
23-Nov-2004 18:08:05 net.sf.hibernate.impl.SessionImpl execute
SEVERE: Could not synchronize database state with session
net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found)


When setting up merge replication on my database it highlights two issues:

1. Uniqueidentifier columns will be added to tables.
2. IDENTITY columns require the NOT FOR REPLICATION option.

It can't be the addition of the extra guid column that's causing the problem, as I've tested adding such a column manually with no issues. As the previous posts correctly state: if you don't tell Hibernate about any extra columns then it will happily ignore them.

The second point is just a recommendation and doesn't seem to affect my tables in any way.

Has anyone had an experience with setting up merge replication and Hibernate? Does Hibernate need to be configured in a particular way to deal with the changes that merge replication causes to the database?

Thanks,

Tim


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.