Hello,
I hope someone can help:
I am using "net.java.ao.schema.StringLength" annotation as shown next because I need to store arbitrary length scripts. I am using Mysql and the field is being created as varchar(255) so it is very limited.
@StringLength(StringLength.UNLIMITED) @Accessor("SCRIPT") @NotNull String getScript(); @StringLength(StringLength.UNLIMITED) @Accessor("SCRIPT") @NotNull void setScript(String script);
Please, any advice would be appreciated.
Thanks in advance.
Community moderators have prevented the ability to post new answers.
Maybe you have already resolved the problem but...
If i were you, I would remove the mutator and accessor annotations, just to test. Also you should make sure you are using AO 0.18.X (when @StringLength annotation was added). You should have something like this on your pom.xml:
<dependency> <groupId>com.atlassian.activeobjects</groupId> <artifactId>activeobjects-plugin</artifactId> <version>0.18.4</version> <scope>provided</scope> </dependency>
You can find more information on AO 0.18.X here:
https://developer.atlassian.com/display/AO/AO+0.18.x+Upgrade+Guide
Perhaps, but regarding versions, JIRA 5.0 shipped with 0.19.7 and JIRA 5.2 with 0.19.16?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ehmm I really don't know, where did you get that info?
I write version 0.18.4 because in AO+0.18.x+Upgrade+Guide they wrote:
"Active Objects 0.18.4 is the first AO version in this series that you should use"
If you write in your pom.xml that you will use, for instance, version 0.9.6 then you will be using that version, at least that's what happened to me, and couldn't use @StringLength annotation because of that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, if you're targetting current releases, you need to use the AO library version they ship with. Documentation accuracy fades over time! Ahm, regarding where this info comes from, in your maven pom.xml, look for activeobjects as a transitive dependency, or check your JIRA_HOME/plugins/.bundled-plugins/activeobjects*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your responses.
I have modified the code with no luck. The "SCRIPT" field shoud be "TEXT" type at database but "VARCHAR" is created.
package com.mnemo.atlassian.jira.plugin.issueimport.ao; import net.java.ao.Accessor; import net.java.ao.Entity; import net.java.ao.Mutator; import net.java.ao.schema.NotNull; import net.java.ao.schema.StringLength; public interface Process extends Entity { @Accessor("NAME") @NotNull String getName(); void setName(String name); @StringLength(value=StringLength.UNLIMITED) @Accessor("SCRIPT") @NotNull String getScript(); @StringLength(value=StringLength.UNLIMITED) @Mutator("SCRIPT") @NotNull void setScript(String script); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Line 6 should be
@Mutator
(
"SCRIPT"
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, whats the question?
I just have this kind of thing to attain an unlimited field, worksforme:
@StringLength(value=StringLength.UNLIMITED)
public void setBlacklistedAttachmentTypes(String blacklistedAttachmentTypes);
public String getBlacklistedAttachmentTypes();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.