Hi,
I created my entity class as required in ActiveObjects plugin, and everything is OK until I add array field.
@Preload public interface XEntity extends Entity { public String getIssueId(); public void setIssueId(String issueId); public String getUserName(); public void setUserName(String userName); public String getName(); public void setName(String name); // public String[] getJiraUser(); // // public void setJiraUser(String[] jiraUser); // // public String[] getProjectRole(); // // public void setProjectRole(String[] projectRole); // // public String[] getIssueRole(); // // public void setIssueRole(String[] issueRole); public String getTopic(); public void setTopic(String topic); public String getContents(); public void setContents(String contents); }
If I uncomment code I get `java.lang.RuntimeException: Unrecognized type` exception. Is that possible to store arrays?
AO supports arrays but not arrays of primitives. So you can use arrays of entities. Replacing String[] with MyOtherEntity[] for example.
Hi, I have similar problem
public interface Filter extends Entity { @OneToMany public Recipt[] getRecipients(); public void setRecipient(Recipt[] recipients); }
public interface Recipt extends Entity { public Filter getFilter(); public void setFilter(Filter filter); }
In my action class I have exception in this line:
final Filter filter = ao.create(Filter.class);
Unrecognized type: [Lpl.skoropada.entities.Recipt;
And I don't know why..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you give a bit more details? Your AO module configuration? The full stack trace? It looks like your get and set methods are not named the same (one has an 's' the other doesn't).
Maybe worth creating a new question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For all who stumble onto this page the answer makes sense because of the relationship between entities. Filter has a @OneToMany relationship with Recipient. This means that the setter is done on the Recipient entity(setting the Filter) and because of the way relational databases work when you call the function getRecipients on Filter it will return an array of recipients. And just like that, Bob's your uncle.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I have similar problem
public interface Filter extends Entity { @OneToMany public Recipt[] getRecipients(); public void setRecipient(Recipt[] recipients); }
public interface Recipt extends Entity { public Filter getFilter(); public void setFilter(Filter filter); }
In my action class I have exception in this line:
final Filter filter = ao.create(Filter.class);
Unrecognized type: [Lpl.skoropada.entities.Recipt;
And I don't know why..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.