-->
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: DoubleStringType example for Hibernate3.1?
PostPosted: Sun Feb 12, 2006 3:49 pm 
Newbie

Joined: Sun Feb 12, 2006 3:33 pm
Posts: 1
All,

I am trying to concat first and last name into a property for presentation and figured I would create a class like in Hibernate2 using DoubleStringType and map like below. No such luck in 3.1. Anyone know of or can provide an example or another way to do this? Basically at a jsp, I want to be able to select lastnamefirstname in a collection that comes from last and first.

<property name="lastnamefirstname" type="nouveon.service.framework.util.StringDoubleType">
<column name="last" />
<column name="first" />
</property>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 12, 2006 4:08 pm 
Regular
Regular

Joined: Sun May 08, 2005 2:48 am
Posts: 118
Location: United Kingdom
<component> ?
<composite-element> ?

http://www.hibernate.org/hib_docs/v3/re ... nents.html


I dont use hibernate myself for this sort of "Presentation" thing, as thats not hibernates job, I use an extra custom method to my POJO that calls the two field getters and creates the concat result. This I believe to be a more correct way.


I understand the purpose of components is to allow recursive internal nesting of POJOs from one SQL bigger represenation. Leaving Hibernate a single named type to be able to use as the containing type. This is most useful with handling the value part of collections.


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.