-->
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.  [ 1 post ] 
Author Message
 Post subject: How to tell hibernate not to map an attribute[SOLVED]
PostPosted: Thu Oct 13, 2011 9:07 am 
Newbie

Joined: Thu Oct 13, 2011 8:59 am
Posts: 1
Greetings,

I have a Java class and I've marked all attributes except one with the @Column annotation so that hibernate can map them. I don't want that particular attribute to be stored in the DB.

I've set everything properly, in fact, if I comment out that attribute Hibernate works fine.

How can I tell Hibernate to ignore that attribute when creating the DB tables and performing save, update, etc.. operations?

Here's a sample of what I'd like to do:
Code:
@Entity
@Table(name = "name")
public class Name implements Serializable{
@Column(name="field1")
private String field1;
@DO_NOT_MAP_THIS
private String field2;
}


Thank you

ps: couldn't search the forum as "my query contained common words"

edit: solved with @Transient


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

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.