-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
@MongoEntity with database parameter does not detect database when using mongo panache #23813
Comments
/cc @FroMage, @evanchooly, @loicmathieu |
@romilpunetha can you link to a reproducer or upload one inside the issue ? This would help us on it a lot. |
Here it is: The following is the annotation on my UserEntity class: However, the db is created using the base db config: |
@loicmathieu Did you get a chance to look into this? |
Hi @romilpunetha there is indead a bug inside the reactive implementation that didn't take the database name from the entity. |
Fixes quarkusio#23813 (cherry picked from commit 0fd7b0d)
Describe the bug
The following is my code structure:
When I'm running this code, mongo panache fails with IllegalArgumentException:
The database attribute was not set for the @MongoEntity annotation and neither was the database property configured for the default Mongo Client (via 'quarkus.mongodb.database').
If I pass the default client using
quarkus.mongodb.database
, all my collections are created in the same database. However, the collections args for @MongoEntity works fine.Expected behavior
When passing @MongoEntity(database = "userDB"), the collection should be created in the userDB database.
Actual behavior
If no default database is passed in application.properties, an error is thrown. Else the collection is created in the default database.
How to Reproduce?
No response
Output of
uname -a
orver
Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64
Output of
java -version
openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment Homebrew (build 17.0.2+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.2+0, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.7.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Java version: 17.0.2, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home Default locale: en_IN, platform encoding: UTF-8 OS name: "mac os x", version: "12.0.1", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: