Skip to content

Commit

Permalink
some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsamson7 committed Oct 10, 2024
1 parent f301a8b commit 7c0e9d0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dorm/core/src/test/kotlin/org/sirius/dorm/AbstractTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ import org.sirius.dorm.model.ObjectDescriptor
import org.sirius.dorm.model.attribute
import org.sirius.dorm.model.relation
import org.sirius.dorm.`object`.DataObject
import org.sirius.dorm.session.DummySessionContextProvider
import org.sirius.dorm.session.SessionContext
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Import
import org.springframework.jdbc.core.JdbcTemplate
import org.springframework.stereotype.Component

@Component
class DummySessionContext : SessionContext(DummySessionContextProvider("me")) {}


@Configuration()
@Import(DORMConfiguration::class)
Expand Down Expand Up @@ -214,6 +219,7 @@ abstract class AbstractTest {

.add(relation("father").target("other-person").multiplicity(Multiplicity.ZERO_OR_ONE).inverse("children"))
.add(relation("children").target("other-person").multiplicity(Multiplicity.ZERO_OR_MANY).inverse("father").owner())
.register()

}

Expand Down
38 changes: 38 additions & 0 deletions dorm/core/src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
spring:
application:
name: dorm
h2:
console:
enabled: true
sql:
init:
mode: always
datasource:
url: jdbc:h2:mem:mydb
username: sa
password: password
driverClassName: org.h2.Driver
jpa:
properties:
hibernate:
format_sql: true
generate_statistics: false
show-sql: true
defer-datasource-initialization: true
hibernate:
ddl-auto: update
naming:
implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
strategy: org.hibernate.cfg.ImprovedNamingStrategy
logging:
level:
org:
xhibernate:
sql: debug
orm:
jdbc:
bind: TRACE
type:
descriptor:
sql: trace

0 comments on commit 7c0e9d0

Please sign in to comment.