Create a oneToMany String field in JBoss Forge

330 views Asked by At

I currently use the 1.4.3 Final version of JBoss Forge, and I am trying to add a field to an Entity. In fact I have a Task Entity, and I would like to add a field which is a list of tags, thanks to a Set.

I tried to do :

field oneToMany --named tags --fieldType string

field oneToMany --named tags --fieldType java.lang.String

field oneToMany --named tags --fieldType java.lang.String.java

But it seems that the field type must be an Entity as well. Should I create another Entity called Tag, with a String field?

1

There are 1 answers

0
Robert Balent On

In JPA, you can't have @OneToMany relationship with String, use @ElementCollection. However I can help you with JBoss Forge You will probably have to add this field manually.