We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've the class "ArticleEntity", "CategoryEntity" and "Article". I've the ArticleEntity:
public class ArticleEntity { ... @ManyToOne @JoinColumn private CategoryEntity categoryEntity; public CategoryEntity getCategoryEntity() { return categoryEntity; } public void setCategoryEntity(CategoryEntity categoryEntity) { this.categoryEntity = categoryEntity; } }
And a class B
public class CategoryEntity { ... private String name; ...getter & setter @OneToMany(mappedBy = "categoryEntity") private List<ArticleEntity> articles; public List<ArticleEntity> getArticles() { if(articles == null) { articles = new ArrayList<>(); } return articles; } public void setArticles(List<ArticleEntity> articles) { this.articles = articles; } }
And a model class:
public class Article { ... private String categoryName; public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } }
With Selma, I make this mapper:
@Mapper(withIgnoreMissing = IgnoreMissing.ALL, withIoC = IoC.SPRING) public interface ArticleMapper { ... @Maps(withCustomFields = { @Field({"categoryEntity.name", "categoryName"}) }) List<Article> articlesFromArticleEntity(List<ArticleEntity> articlesEntity); }
The result of "List Article" mapping is for example:
[0]-> CategoryName: null Content: "Hello here my content" title: "My title here !"
Why mapping list with List doesn't work (CategoryName is null) ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've the class "ArticleEntity", "CategoryEntity" and "Article".
I've the ArticleEntity:
And a class B
And a model class:
With Selma, I make this mapper:
The result of "List Article" mapping is for example:
Why mapping list with List doesn't work (CategoryName is null) ?
The text was updated successfully, but these errors were encountered: