-->
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.  [ 1 post ] 
Author Message
 Post subject: <many-to-any> meta-type working
PostPosted: Wed Dec 17, 2003 12:42 pm 
Newbie

Joined: Tue Dec 16, 2003 6:08 am
Posts: 8
I'm definning my own meta-type for use in <many to any>, the schema is this:
<map name="itsParameters"
table="Element_Parameters"
cascade="all">
<key column="network_parameter_map"/>
<index column="network_parameter_map_key" type="string"/>
<many-to-any id-type="long" meta-type="ClassToIntegerMapper">
<column name="Type" />
<column name="Id" />
</many-to-any>
</map>

Where map is a attribute of a Class that is a MAP of objects.

ClassToInteger is a class that is defined in
http://hibernate.bluemars.net/122.html
I have used this schema of work to map my own classes

public class NEParameterTypeMapper extends ClassToIntegerMapper
{
static public final Integer STRING_TYPE = new Integer(1);
static public final Integer INTEGER_TYPE = new Integer(2);

static final private ClassToIntValue[] mappings =
{
new ClassToIntValue(STRING_TYPE, String.class),
new ClassToIntValue(INTEGER_TYPE, Integer.class)
};

public ClassToIntValue[] getMappings()
{
return mappings;
}
}


but Hibernate gives me an error:
17:32:30,650 INFO [STDOUT] [ObjectDbAccess] *ERROR* (*) Unable to export tables - could not interpret meta-type
I suppose that i don't kown where to put my class in order to hibernate can found it... or something like that... i'm lost.
Can AnyOne Help me,
Thanks in advance,
J.M.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.