-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
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
Unresolved reference: Repository #3258
Comments
Allow me to walk through my experience as a new user to help you guys better understand my journey through the site. I'm documenting this to help you understand my user flow, so that you guys can make the docs easier to use:
|
Good feedback. The docs have an "Improve this doc" link above each section, perhaps you would like to contribute to add clarity to areas you think are lacking? |
Thanks, I might be open to updating docs, but I still haven't gotten this working yet. It may be better to have someone with more domain knowledge do it if anyone is available. The current error I'm running into is the same as this issue: #197. Here are my dependencies for micronaut-data, not sure what I'm missing yet: annotationProcessor("io.micronaut.data:micronaut-data-processor")
implementation("io.micronaut.data:micronaut-data-jdbc")
compileOnly("jakarta.persistence:jakarta.persistence-api") |
You would also need a JDBC driver and a JDBC pool |
Thanks, ok, I've got it working now, it looks like @JdbcRepository(dialect = Dialect.POSTGRES)
interface PostgresAmendmentDao : GenericRepository<AmendmentRequest, Long> {
@Query("""
SELECT *,
fk_bulk_amendment as bulk_amendment_id,
fk_response_id as response_id,
fk_waiver_id as waiver_id
FROM assessment.amendment_request
WHERE id in (:ids)
""", nativeQuery = true)
fun getAmendmentRequests(ids: List<Long>): List<AmendmentRequest>
} |
we have many good guides on the topic with associated sample code like https://guides.micronaut.io/latest/micronaut-data-jdbc-repository.html and https://guides.micronaut.io/latest/micronaut-data-one-to-many.html perhaps links to those would have helped |
So I've read the guides, but unfortunately there are a couple of problems with using the guides as documentation:
I would ask that the micronaut-data developers figure out which packages are required, and which are optional. Then, place that information in a dependencies list at the beginning of the docs. If there are multiple routes a user can take, clearly state that they must pick 1, and clearly list the dependencies for that route. Here are the Compose docs as an example, I think it would be good if the micronaut docs were more like this for the installation instructions: https://developer.android.com/develop/ui/compose/setup |
Expected Behavior
I'm trying to add micronaut-data to an existing project. The docs say to add the following to gradle, which doesn't work:
annotationProcessor("io.micronaut.data:micronaut-data-processor")
I'm getting the error
Unresolved reference: Repository
when I try to add the@Repository
annotation to an interface. The docs mention a runtime dependency, but they don't tell what it is. This is basic stuff guys, I shouldn't have to do an hour of research to figure out all of the required packages, this needs to be in the docs. The docs seem to assume that you're going to regenerate a new micronaut starter project every time, which isn't convenient at all.After further research, it looks like there are a variety of possible dependencies scattered throughout the docs. These should all be moved to up at the top under the
Build Configuration
heading, and it should be clearly stated that you have to install one of them. As a user, I should be able to install micronaut-data and start using it quickly, without having to read and understand the entire documentation. There needs to be a "getting started" section that clearly states what you need to do to install it and get started, just like most other libraries.Actual Behaviour
The docs should correctly state how to install micronaut-data.
Steps To Reproduce
No response
Environment Information
No response
Example Application
No response
Version
Latest
The text was updated successfully, but these errors were encountered: