Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Update record with @EmbeddedId

$
0
0
Can't find any information about that.
How do I update DB objects with an EmbeddedId in serverType="hibernate" ?

Code:

<field name="key" primaryKey="true" canEdit="false" />
Code:

@Override
        @EmbeddedId
        public QueryMessagePersistPK getKey() {
                return key;
        }

Code:

@Embeddable
public class QueryMessagePersistPK implements Serializable {

        /**
        *
        */
        private static final long serialVersionUID = 1L;
        @Id
        private long id;
        @Id
        private long query_info_id;

        public QueryMessagePersistPK() {

        }

        public QueryMessagePersistPK(QueryInfoODB queryInfo, long messageId) {
                id = messageId;
                query_info_id = queryInfo.getId();
        }

If I try to set the key a got from the fetch I get a
Code:

java.lang.ClassCastException: Value '{id=2263993, query_info_id=75229}' of type 'class java.lang.String' can not be cast to type 'class com.evizone.rbp.model.persist.QueryMessagePersistPK'.
        at com.isomorphic.util.DataTools.castValue(DataTools.java:4525)

Where do I implement the translation?

Viewing all articles
Browse latest Browse all 4756

Trending Articles