Hi,
We are using JIRA5.0.2 and we have implmented active objects plugins for our own entiites. Plugin is deployed successfull showing in plugin section but when go to jira database to find the ao table , it is not getting created autometically after deploying AO plugins. And there is no error in logs also. How to debug where the problme occured and when tables will be created after deploying active object plugin. Help is highly appriciated.
Regards,
Tom
Community moderators have prevented the ability to post new answers.
https://answers.atlassian.com/questions/153872/how-to-store-data-into-database
link will help you to develop active object.
-----------------------------------------------------------------
Pom.xml
<dependency>
<groupId>com.atlassian.labs</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>0.5</version>
<type>atlassian-plugin</type>
</dependency>
atlassian-plugin.xml
<ao key="ao-issueConfig">
<description>The module configuring the Active Objects service used by this plugin</description>
<entity>com.POJOCLASSREF</entity>
</ao>
POJOCLASSREF.java
public interface POJOCLASSREF extends Entity
{
// getter and setter methods
}
MainJAVACLASS.java
Depends on plugin module you can use ao, eg. Use ActiveObject in construction injection.
public class MainJAVACLASS
{
private final ActiveObjects ao;
}
public MainJAVACLASS(ActiveObject ao)
{
this.ao=ao;
}
and use ao object where ever you want in bussiness logic.
to store data in to DB
use ao scenario like this
ao.executeInTransaction(new TransactionCallback<POJOCLASSREF>() {
public IssueConfig doInTransaction()
{
final POJOCLASSREF pojoref=ao.create(POJOCLASSREF.class);
// USE SETTER METHOD TO SET PARAMETERS TO STORE IN DB
return pojoref;
}
});
----------------------------------------------------------------------
Below link does contain brief discussion on Active objects, above steps is one of them.
https://answers.atlassian.com/questions/153872/how-to-store-data-into-database
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have the AO definitions in atlassian-plugin.xml?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jobin,
I have AO definiation in in atlassian-plugin.xml, but here my question is that as soon as i deploy myplugin in to our jira application, will the ao tables be created autometically or do we need to do any coding for creating tables?.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tom yes you will need to create an entity class which will define your table in the database . refer this tutorial .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tom you need to define entity classes but you don't need to do anything after restart. The tables will be created automatically on restart if the plugin has the correct AO and entity definitions in place.
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.