eclipse / jnosql

Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.
Other
229 stars 72 forks source link

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

Closed m4ttek closed 12 months ago

m4ttek commented 1 year ago

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

otaviojava commented 1 year ago

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

dearrudam commented 11 months ago

@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?

otaviojava commented 11 months ago

@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.

dearrudam commented 11 months ago

@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?