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

XXX XXX November 14, 2013

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
Answer accepted
XXX XXX November 17, 2013

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
TAGS
AUG Leaders

Atlassian Community Events