-->
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: CollectionId annotation problem. Help!!
PostPosted: Tue Dec 04, 2007 5:01 pm 
Newbie

Joined: Sat Dec 25, 2004 11:18 pm
Posts: 11
Hello All

I am trying to create a idbag using annotation. Here is the code:


@org.hibernate.annotations.CollectionOfElements
@org.hibernate.annotations.CollectionId(
columns = @Column(name = "collId"),
type = @org.hibernate.annotations.Type(type = "int"),
generator = "int"
)
@JoinTable(
name="OwnerCollection",
joinColumns={@JoinColumn(name="FK_ownerId")}
)
@Column(name="collStr")
public Collection<String> getColl() {
return coll;
}

public void setColl(Collection<String> coll) {
this.coll = coll;
}


The above code fails while executing following sql:

/* insert collection
row com.glassdoor.bizproj.employer.Owner.coll */ insert
into
OwnerCollection
(FK_ownerId, collid, collStr)
values
(?, ?, ?)

2007-11-30 14:50:56,027 DEBUG [main] - binding '25' to parameter: 1
2007-11-30 14:50:56,027 DEBUG [main] - binding 'POST_INSERT_INDICATOR' to parameter: 2
2007-11-30 14:50:56,027 INFO [main] - could not bind value 'POST_INSERT_INDICATOR' to parameter: 2;

As you can see above, hibernate is trying to attach a string-POST_INSERT_INDICATOR to collectionId column that i declared through annotation above.

Why is hibernate putting 'POST_INSERT_INDICATOR' in INTEGER column?
How do i fix it ?

I have looked at the tutorial Item example. But nothing seems wrong with my code.

What am I missing here ?

Thanks in advance!!!

Regards

Manan

Core Hibernate --- 3.2.5.ga
Hibernate annotation---3.3.0.ga
Database---MySql


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.