-->
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: using collection interface problem.
PostPosted: Fri Jul 11, 2008 12:18 am 
Newbie

Joined: Fri Jul 11, 2008 12:04 am
Posts: 1
I'm newbee in hibernate. and i'm korean and i cann't speak english well.
please understand me.

I have a problem using collcetion.
Exception is "Could not determine type for: String, for columns: [org.hibernate.mapping.Column(tag)]

Now show my sql script and *.hbm.xml and java file.

i make two table, studing collection Set type.
this is simple article tag example.

create table article(
id int not null auto_increment,
title varchar(20),
primary key (id)
);

create table article_tag(
article_id int not null,
tag varchar(50),
foreign key (article_id) references article(id)
);

and show hbm.xml

<hibernate-mapping package="model">
<class name="Article" table="ARTICLE">
<id name="id" column="ID">
<generator class="identity" />
</id>
<property name="title" />
<set name="tags" table="ARTICLE_TAG">
<key column="ARTICLE_ID" />
<element type="String" column="tag" />
</set>
</class>
</hibernate-mapping>

and show log bean class.

public class Article {
private int id;
private String title;
private Set<String> tags = new HashSet<String>();

public Article() {}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Set<String> getTags() {
return tags;
}
public void setTags(Set<String> tags) {
this.tags = tags;
}
}

and if i test that code.
hibernate make exception this.
org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Column(tag)]

pleast help me.




Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
mysql
The generated SQL (show_sql=true):
yes
Debug level Hibernate log excerpt:
yes

Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


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.