Problem with ManyToMany active objects relationship [a.o 0.24, confluence 5.3.1]

Hi all,

I have a problem with active objects. Here are the different classes defined. Could you tell me what's wrong? I am using oracle database, a.o 0.24 and confluence 5.3.1.

Document:

public interface Document extends BaseModel {

	@NotNull
	public String getTitle();

	public void setTitle(String title);

	@ManyToMany(reverse = "getDocument", through = "getKeyword", value = DocumentToKeyword.class)
	public Keyword[] getKeywords();

	public void setKeywords(Keyword[] keywords);

	@ManyToMany(reverse = "getDocument", through = "getCategory", value = DocumentToCategory.class)
	public Category[] getCategories();

	public void setCategories(Category[] categories);

	public String getDescription();

	public void setDescription(String description);

	@NotNull
	public InputStream getDocument();

	public void setDocument(InputStream document);

	public InputStream getDocumentPreview();

	public void setDocumentPreview(InputStream documentPreview);

	@NotNull
	public int getPublicationYear();

	public void setPublicationYear(int publicationYear);

	@NotNull
	public String getAuthor();

	public void setAuthor(String author);

	public String getType();

	public void setType(String type);

}

Category:

public interface Category extends BaseModel {

	@NotNull
	public String getName();

	public void setName(String name);

	@ManyToMany(reverse = "getCategory", through = "getDocument", value = DocumentToCategory.class)
	public Document[] getDocuments();

	public void setDocuments(Document[] documents);

}

Keyword

public interface Keyword extends BaseModel {

	@NotNull
	public String getName();

	public void setName(String name);

	@ManyToMany(reverse = "getKeyword", through = "getDocument", value = DocumentToKeyword.class)
	public Document[] getDocuments();

	public void setDocuments(Document[] documents);
}

And the two mapping classes:

public interface DocumentToCategory extends Entity {

	public Document getDocument();

	public void setDocument(Document document);

	public Category getCategory();

	public void setCategory(Category category);

}

public interface DocumentToKeyword extends Entity {

	public Document getDocument();

	public void setDocument(Document document);

	public Keyword getKeyword();

	public void setKeyword(Keyword keyword);

}

If I remove those two fields (Category/Keyword) from my Document entity everything works fine.

Here are my entities defined:

<ao key="ao-module">
		<description>The module configuring the Active Objects service used by
			this plugin
		</description>
		<entity>confluence.plugin.model.Category</entity>
		<entity>confluence.plugin.model.Document</entity>
		<entity>confluence.plugin.model.Rating</entity>
		<entity>confluence.plugin.model.Keyword</entity>
		<entity>confluence.plugin.model.DocumentToKeyword</entity>
		<entity>confluence.plugin.model.DocumentToCategory</entity>
	</ao>

1 answer

1 accepted

0 votes
Accepted answer

The problem is the definition of the setters in the classes Document/Keyword. It seems it s not possible to do so. After simply removing them the schema is correctly created in the database.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in New to Confluence

How to use Confluence Cloud for stakeholder management

Most of us don’t need much convincing that stakeholder management is important. It just makes sense that keeping everyone in-the-know on projects and assigning clearly defined roles is key to having ...

1,015 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you