ActiveObjects: Collections of basic types for as fields?

Hi there,

with hibernate there is a fairly straightforward way to have Collections of basic types as a type for the field of an entity. e.g. a field with the type of Set<String>.

See: http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-ofvalues

I can't find any evidence that this is possible with activeObjects - is it?

Cheers

Claudio

1 answer

1 accepted

This widget could not be displayed.

Hi Claudio,

There is no something like ElementCollection/CollectionTable in AO,

Only way is to have parent-child DB relation and then in parent entity you have @OneToMany:

// I guess that reverse is optional if you only one relation between parent-child tables
@OneToMany(reverse = "getParentEntity")
public ChildEntity[] getChildEnitities();

But ChildEntity would have to implement Entity, right? I.e. you couldn't do

@OneToMany
public String[] getNames()

could you? I have tried that of course, but I was wondering if I might just have missed something.

Thanks for your answer, btw smile

But ChildEntity would have to implement Entity, right? 

 Right.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

28 views 3 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you