[jboss-user] [JBoss Seam] - Problem with editing entity if it uses @EmbeddedId
pczekaj
do-not-reply at jboss.com
Thu Aug 3 01:28:12 EDT 2006
I'm having problems with editing entity with @EmbeddedId. On page I've placed inputText element for every PK field, for example:
<h:inputText id="id_nr" value="#{uscModpskr.id.nr}" required="true"/>
I can see in inputText proper values fetched from database but when I click h:commandButton I'm getting 5 times Conversion error occurred message. My PK contains 5 fields: 2 strings, 2 ints, one char field.
| @Stateful
| @Name("marriageSearch")
| @Scope(ScopeType.SESSION)
| public class MarriageSearchingAction implements MarriageSearching, Serializable {
|
| @In(required=false)
| @Out(required=false)
| private UscModpskr uscModpskr;
|
| //[...]
| }
|
| // Generated 2006-06-04 20:38:58 by Hibernate Tools 3.1.0.beta5
| @Entity
| @Table(name = "usc_modpskr", uniqueConstraints = {})
| @Name("uscModpskr")
| public class UscModpskr implements java.io.Serializable {
|
| // Fields
| private UscId id;
|
| private String dzpl;
| //[...many other fields...]
|
| @EmbeddedId
| @AttributeOverrides( {
| @AttributeOverride(name = "idusc", column = @Column(name = "idusc", unique = false, nullable = false, insertable = true, updatable = true, length = 10)),
| @AttributeOverride(name = "rk", column = @Column(name = "rk", unique = false, nullable = false, insertable = true, updatable = true)),
| @AttributeOverride(name = "dz", column = @Column(name = "dz", unique = false, nullable = false, insertable = true, updatable = true, length = 20)),
| @AttributeOverride(name = "nr", column = @Column(name = "nr", unique = false, nullable = false, insertable = true, updatable = true)),
| @AttributeOverride(name = "nrp", column = @Column(name = "nrp", unique = false, nullable = false, insertable = true, updatable = true, length = 1)) })
| public UscId getId() {
| return this.id;
| }
|
| public void setId(UscId id) {
| this.id = id;
| }
| }
|
| @Embeddable
| public class UscId implements java.io.Serializable {
|
| private String idusc;
|
| private int rk;
|
| private String dz;
|
| private int nr;
|
| private char nrp;
|
| //[...getters and setters...]
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962709#3962709
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962709
More information about the jboss-user
mailing list