I have followed the documentation and added all the required code in my plugin still I cannot see the table when I check the plugin data storage.
atlassian-plugin.xml
<component key="ProdConfServic" name="Prod Setting Service" class="com.leanpitch.leangears.ao.ProdConfServiceImpl" public="true"> <interface>com.leanpitch.leangears.ao.ProdConfService</interface> </component> <ao key="ao-module"> <entity>com.leanpitch.leangears.ao.ProdConf</entity> </ao> <component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects"> <description>Component to access Active Objects functionality from the plugin</description> </component-import> <component key="tx-processor" name="Transactional Annotation Processor" class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor"> <decription>Processes @Transactional annotations.</decription> </component>
ProdConf.java
import net.java.ao.Accessor; import net.java.ao.Entity; import net.java.ao.Mutator; import net.java.ao.Preload; import net.java.ao.schema.StringLength; import net.java.ao.schema.Table; @Preload @Table("ProdConf") public interface ProdConf extends Entity{ @Accessor("ProductName") String getProductName(); @Mutator("ProductName") void setProductName(String productName); @Accessor("EndUsers") String getEndUsers(); @Mutator("EndUsers") void setEndUers(String endUers); }
ProdConfService.java
@Transactional public interface ProdConfService { void add(String productName, String endUsers); }
ProdConfServiceImpl.java
import com.atlassian.activeobjects.external.ActiveObjects; import net.java.ao.Query; import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Lists.newArrayList; /** * Created by root on 30/4/15. */ public class ProdConfServiceImpl implements ProdConfService{ private final ActiveObjects ao; public ProdConfServiceImpl(ActiveObjects ao){ this.ao = checkNotNull(ao); } @Override public void add(String productName, String endUsers){ final ProdConf prodConf = ao.create(ProdConf.class); prodConf.setProductName(productName); prodConf.setEndUers(endUsers); prodConf.save(); } }
Community moderators have prevented the ability to post new answers.
Do not worry, it's there. The table name is prefixed with some hash number like "AO_123456" so you table name should be name "AO_123456_PRODCONF"
Thanks Volodymyr, but I could not find any such table in Plugin data storage
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any exceptions in the log? What version of the activeobjects-plugin do you have in the pom?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I checked the log and it does not show anything. <dependency> <groupId>com.atlassian.activeobjects</groupId> <artifactId>activeobjects-plugin</artifactId> <version>0.23.12</version> <scope>provided</scope> </dependency> <!-- SAL, the Active Objects plugin uses SAL's API for transactions --> <dependency> <groupId>com.atlassian.sal</groupId> <artifactId>sal-api</artifactId> <version>2.6.0</version> <scope>provided</scope> </dependency>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What happens when you execute/debug the code that actually use AOs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same version of the sal-api and mine activeobjects-plugin is 0.29.3. The rest code is similar to yours.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Volodymyr. It's working fine now as there was a problem with the call I was making to the service Impl code. Thanks for your assistance!
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.