-->
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.  [ 2 posts ] 
Author Message
 Post subject: Discard fields mapping/initialize during execution time
PostPosted: Wed Jan 20, 2010 3:47 pm 
Newbie

Joined: Wed Jan 20, 2010 3:43 pm
Posts: 3
I have a POJO as below

public class CategoryVO implements Serializable, Cloneable {

private long categoryId;
private String categoryName;
private List<ChannelVO> channelList;

public void setCategoryId(long categoryId) {
this.categoryId = categoryId;
}

public long getCategoryId() {
return categoryId;
}

public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}

public String getCategoryName() {
return categoryName;
}

public void setChannelList(List<ChannelVO> channelList) {
this.channelList = channelList;
}

public List<ChannelVO> getChannelList() {
return channelList;
}
}

When I execute a criteria for this class, all fields are populated per the mapping.

What I want is the control over populating channelList during execution time. Is there a way I can do that, since populating channelList is an expensive process and sometimes we would only need category and not channels.


Top
 Profile  
 
 Post subject: Re: Discard fields mapping/initialize during execution time
PostPosted: Thu Jan 21, 2010 10:32 am 
Newbie

Joined: Wed Jan 20, 2010 3:43 pm
Posts: 3
vijaych1209 wrote:
I have a POJO as below

public class CategoryVO implements Serializable, Cloneable {

private long categoryId;
private String categoryName;
private List<ChannelVO> channelList;

public void setCategoryId(long categoryId) {
this.categoryId = categoryId;
}

public long getCategoryId() {
return categoryId;
}

public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}

public String getCategoryName() {
return categoryName;
}

public void setChannelList(List<ChannelVO> channelList) {
this.channelList = channelList;
}

public List<ChannelVO> getChannelList() {
return channelList;
}
}

When I execute a criteria for this class, all fields are populated per the mapping.

What I want is the control over populating channelList during execution time. Is there a way I can do that, since populating channelList is an expensive process and sometimes we would only need category and not channels.

With control I mean, not fetching channelList (set to null) and just get the criteria.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.