Skip to content

Commit

Permalink
Slight doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
blootsvoets committed Oct 19, 2023
1 parent 4ef6ddb commit 9eb404c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ class MyEnhancerFactory(private val config: MyConfigClass): EnhancerFactory {
}

class MyResourceEnhancer: JerseyResourceEnhancer {
// only classes used directly by Jersey, cannot inject them in user code
override val classes: Array<Class<*>> = arrayOf(
Filters.logResponse,
Filters.cors,
Filters.cache,
)

// only classes used directly by Jersey, cannot inject them in user code
override val packages = arrayOf(
"com.example.app.resources",
)
Expand All @@ -118,7 +120,10 @@ class MyEnhancerFactory(private val config: MyConfigClass): EnhancerFactory {
bind(config)
.to(MyConfigClass::class.java)
bind(MyService::class.java)
.to(MyService::class.java)
.to(MyServiceInterface::class.java)
.`in`(Singleton::class.java)
bindFactory(OtherServiceFactory::class.java)
.to(OtherServiceInterface::class.java)
.`in`(Singleton::class.java)
}
}
Expand Down
11 changes: 4 additions & 7 deletions radar-jersey-hibernate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ Database extensions for radar-jersey. Includes support for [Hibernate](https://h

Add this library to your project using the following Gradle configuration:
```kotlin
repositories {
maven(url = "https://dl.bintray.com/radar-base/org.radarbase")
}

dependencies {
implementation("org.radarbase:radar-jersey-hibernate:<version>")
}
Expand All @@ -23,9 +19,10 @@ Example repository code:

```kotlin
class ProjectRepositoryImpl(
@Context em: Provider<EntityManager>
): ProjectRepository, HibernateRepository(em) {
fun list(): List<ProjectDao> = transact {
@Context em: Provider<EntityManager>,
@Context asyncService: AsyncCoroutineService,
): ProjectRepository, HibernateRepository(em, asyncService) {
suspend fun list(): List<ProjectDao> = transact {
createQuery("SELECT p FROM Project p", ProjectDao::class.java)
.resultList
}
Expand Down

0 comments on commit 9eb404c

Please sign in to comment.