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
|