Questions tagged [micronaut-data]
210 questions
2
votes
0 answers
Micronaut-Data issue with custom datasource
I have create sample project with custom datasource
micronaut:
application:
name: demo
datasources:
customerDS:
url: jdbc:h2:file:./DATA/devDB;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=TRUE
driverClassName: org.h2.Driver
…

Balasubramanian Rengasamy
- 139
- 2
- 13
2
votes
1 answer
Micronaut-data : No current JDBC Connection found. Consider wrapping this call in transactional boundaries
I am getting No current JDBC Connection found. exception while using micronaut-data, i am referring to https://github.com/tdisanti/micronaut-single-ucp
micronaut…

2787184
- 3,749
- 10
- 47
- 81
2
votes
1 answer
Build micronaut native image with hikari datasource
Faced with a problem running micronaut application that was packed in native-image.
I created simple demo application with micronaut-data-hibernate-jpa and based on documentation I need to add some db connection pool. I chose hikari and added such…

Aliaksei Bulhak
- 6,078
- 8
- 45
- 75
2
votes
1 answer
Example count query for Micronaut data @Query
Can someone give an example countQuery to implement pagination while doing explicit query (@Query) using Micronaut data? There is no examples at https://micronaut-projects.github.io/micronaut-data/latest/guide/#explicitQueries
I have to make a query…

Sujith C P
- 105
- 1
- 11
2
votes
1 answer
How to use beans inside classes that are not managed by the Micronaut?
I have an entity with a created by field and I need to populate this field using the AuthenticatedUserService that I created. I need to inject this service in the entity such that I can generate the value for the created by field.
This is my…

Shraday Shakya
- 41
- 6
2
votes
2 answers
Associate JDBC Datasource Name Using @JdbcRepository annotation
In the docs, it states,
The @JdbcRepository annotation accepts an optional string value which represents the name of the connection or datasource in a multiple datasource scenario. By default Micronaut Data will look for the default…

ustad
- 459
- 1
- 6
- 21
2
votes
2 answers
In MicronautProject, using hibernate specifications throw exception: Could not obtain transaction-synchronized Session for current thread
I'm studying micronaut. when I use hibernate in micronaut project.Everything is OK.I study in docs.micronaut.io. However I use specifications. throw exception:
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for…

SMLZ
- 21
- 2
2
votes
0 answers
Micronaut mock repository interface with Replace annotation
I have a repository implementation of type CrudRepository. Im trying to mock this interface with another interface that extends of it.
I noticed that if I invoke findAll method it works as expected, but when I invoke the findById method I get an…
2
votes
1 answer
Creating composable repositories in micronaut
I am trying to implement a method using a composable repository in micronaut.
I have:
@Repository
public interface EmployeeRepository extends CrudRepository, EmployeeRepositoryCustom {
}
Here, the EmployeeRepositoryCustom is an…

Rajshree Rai
- 533
- 7
- 14
2
votes
1 answer
Micronaut data and Enum fields in Entities
Does micronaut-data support enum fields?
I tried creating enum field resulted in error. Added type converter using Micronaut TypeConverter framework but still same error that it states
java.lang.NoSuchMethodError: 'void…

metasync
- 338
- 1
- 10
2
votes
1 answer
Micronaut Data's cascade persist doesn't save child objects
After saving the owning entity object which creates new child objects, a strange thing happens. Only the owning object is saved, though the SQL logs also shows inserts for the child entities.
Team
@Data
@EqualsAndHashCode(of =…

Jan Korcak
- 41
- 4
2
votes
3 answers
How can I create simple count queries inside Repository with Micronaut Data JDBC?
I'm trying to create a count native query inside a Micronaut Data JDBC repository. I'm using:
@JdbcRepository(dialect = Dialect.POSTGRES)
public abstract class BookRepository implements GenericRepository {
…

Caetano
- 21
- 1
2
votes
1 answer
Micronaut Data - Pageable or Flowable.skip().limit()?
I was wondering if someone could explain the differences and pros and cons of each approach. Ie. the underlying queries to DBs, performance, etc
RxJava approach
RxJavaCrudRepository.findAll().skip(offset).limit(max)
Pageable…

OsaSoft
- 589
- 5
- 19
2
votes
2 answers
Micronaut-data mocking CrudRepository with Micronaut-test
I try to write UnitTest for my API controller which use a CrudRepository from micronaut-data-jpa. I use @MockBean to Mock the collaborated repository in my controller. If I run the Test I got the following error:
Message: No such method…

jworuna
- 21
- 1
- 2
1
vote
1 answer
Micronaut's Page used as a controller method return type is serialized without Page properties
I'm trying to implement a simple paged API using Micronaut 3.7.9, with micronaut-serde-jackson and I've encountered an issue with how my response is serialized, as Page properties are not included. My controller method return type is…

user19771288
- 35
- 5