-->
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: CompositeUserType containing a collection
PostPosted: Fri Feb 14, 2014 11:30 am 
Newbie

Joined: Fri Feb 14, 2014 11:16 am
Posts: 6
Hi.

How can I create a CompositeUserType containing a collection in hibernate 4.3?
I tried to create the CompositeUserType as follows:
Code:
public class MyType implements CompositeUserType {
    @Override
    public Type[] getPropertyTypes() {
        return new Type[]{StringType.INSTANCE /* , SetType */};
    }
}

For a class like
Code:
public class My {
    private String name;
    private Set<Integer> numbers;
    // ...
}

But how do I get an instance of SetType to accomplish the desired result?

Looking at the javadoc of CompositeUserType#deepCopy():
Quote:
Return a deep copy of the persistent state, stopping at entities and at collections.

I think, that it should be possible to embed collections into CompositeUserTypes.

Regards
Christian


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.