-->
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: proper mapping of java 5 generics as ArrayLists
PostPosted: Thu Jan 18, 2007 7:07 pm 
Newbie

Joined: Thu Jan 18, 2007 6:54 pm
Posts: 3
Location: Dallas
Hibernate version: 3


First, thanks in advance for any help. My problem concerns the proper mapping of a Java 5 generic class as an ArrayList to non-generic classes.

Here is the situation.
I have a generic class called Range

public class Range<T>{
private long id;
private Money charge; //Another user type
private T min;
private T max;
.
.
.
}

The above ranges class is accessed in another class ValueRateTable:

public class ValueRateTable{
private long id;
.
.
.
List<Range<Money>> ranges = new ArrayList<Range<Money>>();
.
.
.
}

Can someone give me some direction as to where I should be looking to understand the mapping dynamics associated with this type of architecture? The idea is to have new RateTable classes, i.e. WeightRateTable, that utilize the generic quality of the Range class to pass the appropriate min and max types (for example the WeightRateTable may have List<Range<Weight>>). Any help would be appreciated.


Top
 Profile  
 
 Post subject: Follow up
PostPosted: Fri Jan 19, 2007 4:03 pm 
Newbie

Joined: Thu Jan 18, 2007 6:54 pm
Posts: 3
Location: Dallas
As a follow up question:

Does anyone know if this is even possible? Does hibernate support generics at all or am I just barking mad?


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.