-->
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: Need HibernateTypeMap Anonnation Tips
PostPosted: Fri Dec 30, 2005 2:30 am 
Beginner
Beginner

Joined: Fri Dec 26, 2003 3:21 pm
Posts: 23
Location: Jakarta
I have a static like this:

static {
classToHibernateTypeMap.put(Boolean.class, Hibernate.BIG_DECIMAL);
classToHibernateTypeMap.put(Boolean.class, Hibernate.BOOLEAN);
classToHibernateTypeMap.put(Byte.class, Hibernate.BYTE);
classToHibernateTypeMap.put(Character.class, Hibernate.CHARACTER);
classToHibernateTypeMap.put(Date.class, Hibernate.DATE);
classToHibernateTypeMap.put(Double.class, Hibernate.DOUBLE);
classToHibernateTypeMap.put(Float.class, Hibernate.FLOAT);
classToHibernateTypeMap.put(Integer.class, Hibernate.INTEGER);
classToHibernateTypeMap.put(Long.class, Hibernate.LONG);
classToHibernateTypeMap.put(Short.class, Hibernate.SHORT);
classToHibernateTypeMap.put(String.class, Hibernate.STRING);
classToHibernateTypeMap.put(Timestamp.class, Hibernate.TIMESTAMP);
}

and I try to implement Hibernate Anonation, and I am new on Anonation,

the eclipse show this message:

Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic
type Map<K,V> should be parameterized


can help?

Frans


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 01, 2006 2:07 pm 
Regular
Regular

Joined: Wed May 05, 2004 8:01 am
Posts: 53
This is only a warning concerning JDK 5.0 Generics. You can simply press Ctrl+1 on warning location and add @SuppressWarnings directive or change classToHibernateTypeMap declaration from something like:

Code:
Map  classToHibernateTypeMap = new HashMap();


to

Code:
Map<Class, Integer>  classToHibernateTypeMap = new HashMap<Class,Integer>();


or anything that Hibernate.BIG_DECIMAL type is.

did that help?


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.