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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

89 views 0 6
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