Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion grails-data-graphql/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies {
testImplementation 'com.github.fakemongo:fongo:2.1.1'
testImplementation 'com.h2database:h2:2.2.224'
testImplementation 'org.apache.tomcat:tomcat-jdbc:8.5.97'
testImplementation "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.2"
testImplementation "org.slf4j:slf4j-api:$slf4jVersion"
}

Expand Down
1 change: 0 additions & 1 deletion grails-data-graphql/examples/spring-boot-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ dependencies {
implementation 'junit:junit'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.apache.tomcat:tomcat-jdbc'
runtimeOnly "org.apache.tomcat.embed:tomcat-embed-logging-log4j"
implementation 'jakarta.persistence:jakarta.persistence-api'

runtimeOnly "javax.el:javax.el-api"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ specific language governing permissions and limitations
under the License.
////

If you wish to use GORM for Hibernate outside of a Grails application you should declare the necessary dependencies for GORM and the database you are using, for example in Gradle:
If you wish to use GORM for Hibernate outside a Grails application you should declare the necessary dependencies for GORM and the database you are using, for example in Gradle:

[source,groovy,subs="attributes"]
----
compile "org.apache.grails.data:grails-data-hibernate5-core:{version}"
runtime "com.h2database:h2:1.4.192"
runtime "org.apache.tomcat:tomcat-jdbc:8.5.0"
runtime "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.0"
runtime "org.slf4j:slf4j-api:1.7.10"
implementation platform("org.apache.grails:grails-bom:{version}")
implementation "org.apache.grails.data:grails-data-hibernate5-core"
runtimeOnly "com.h2database"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "org.slf4j:slf4j-nop"
----

NOTE: The above example also uses the https://www.h2database.com[H2 Database] and Tomcat connection pool.
However other pool implementations are supported including `commons-dbcp`, `tomcat pool` or `hikari`.
However, other pool implementations are supported including `commons-dbcp`, `tomcat pool` or `hikari`.
If a connection pool is not specified `org.springframework.jdbc.datasource.DriverManagerDataSource` is used,
which creates a new connection to the database each time you request a connect.
which creates a new connection to the database each time you request a connection.
The latter will probably cause issues with an H2 in-memory database in that it will create a new in-memory
database each time a connection is requested, losing previously created tables.
Normal databases (`MySql`, `Postgres` or even file-based `H2`) are not affected.
Expand All @@ -40,6 +40,9 @@ Then create your entities in the `src/main/groovy` directory and annotate them w

[source,groovy]
----
import grails.gorm.annotation.Entity
import org.grails.datastore.gorm.GormEntity

@Entity
class Person implements GormEntity<Person> { // <1>
String firstName
Expand Down
Loading