-->
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 Field From POJO
PostPosted: Sun Sep 16, 2007 4:22 pm 
Newbie

Joined: Sun Sep 16, 2007 9:45 am
Posts: 6
Hi,

I have a POJO class which is mapped to a table. I would also like to have a field in the pojo which is not mapped to any tables.

My POJO class
Code:
@Entity(name = "test")
@Table(appliesTo = "test")
class Test {
   
    @Id
    @GeneratedValue
    private Integer id; // --> Mapped to id column in the table

    private byte visibility;  // --> Mapped to visibility column in the table

    private int shardID ; // --> This is NOT mapped to any column.

.. getters & setters
}



When I use the above POJO, hibernate assumes that shardID column is present in table and tries to look up and fails. Is there any way, I can use annotations to disable this field from getting assumed as a table column ?

Thanks,
Rakesh


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 9:07 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 7:29 am
Posts: 36
Remove the column from the mapping file as well....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 10:45 am 
Newbie

Joined: Sun Sep 16, 2007 9:45 am
Posts: 6
shardul.bhatt wrote:
Remove the column from the mapping file as well....


Maybe you missed it. I am not using mapping files but Annotations. I want to know a way to disable a column using Annotations.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 11:04 am 
Newbie

Joined: Tue Aug 28, 2007 12:54 pm
Posts: 16
Location: Munich, Germany
@Transient

_________________
www.tomeicher.de


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 1:28 pm 
Beginner
Beginner

Joined: Fri Sep 08, 2006 7:29 am
Posts: 36
Right on target cheesus!!!


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.