eclipse / jnosql

Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Lack of descriptive error when trying to inject a Repository with type without @Entity annotation

m4ttek opened this issue · comments

Which JNoSQL project the issue refers to?

JNoSQL Databases

Bug description

I had to debug internal classes of jnosql to get information why there is a problem with my own repository class / interface.

There is a class which scans for any Repositories interfaces present in your project. Unfortunately, it silently filters out found interfaces for which entity type lacks @entity annotation using given filter:
image

During application start and injection processing you get an error about no object present which should implement your repository interface.

JNoSQL Version

1.0.1

Steps To Reproduce

  1. Use Helidon 3.2.2 with MP in your project (however I don't think this framework matters).
  2. Extend ArangoDBRepository interface concerning any type lacking @entity annotation.
  3. Inject your repository in any other class and try to use it.

Expected Results

Descriptive error why there is no possibility to create Repository bean in CDI.

Code example, screenshot, or link to a repository

No response

Thank you for reaching out; we will work on this issue ASAP.

@otaviojava , this change will broken up the idea to use a non-entity classes being retrieved from data-sources non-database kind, e.g. data from rest API resources, am I right?

@dearrudam Nope, the Jakarta Data is annotation agnostic; it might work with any annotation, such as JPA and NoSQL. However, it does not mean that no documentation is necessary; the Jakarta Data vendor should do its validation about annotations.

E.g., A Jakarta Data provider using JPA will read and use the JPA annotations.

@otaviojava gotcha! That's the reason why JNoSQL is doing this validation now, as its implementation deals with NoSQL persistence. Correct me if I'm wrong, please?