-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from felixscheinost/feature/194_auditable_han…
…dle_composite_id Handle composite ID
- Loading branch information
Showing
7 changed files
with
111 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
language: groovy | ||
dist: trusty | ||
sudo: false | ||
cache: | ||
directories: | ||
|
19 changes: 19 additions & 0 deletions
19
examples/audit-test/grails-app/domain/test/CompositeId.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test | ||
|
||
import grails.plugins.orm.auditable.Auditable | ||
|
||
class CompositeId implements Auditable, Serializable { | ||
|
||
Author author | ||
String string | ||
NonAuditableCompositeId nonAuditableCompositeId | ||
|
||
String notIdString | ||
|
||
static constraints = { | ||
} | ||
|
||
static mapping = { | ||
id composite:['author', 'string', 'nonAuditableCompositeId'] | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
examples/audit-test/grails-app/domain/test/NonAuditableCompositeId.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test | ||
|
||
class NonAuditableCompositeId implements Serializable { | ||
|
||
String foo | ||
String bar | ||
|
||
@Override | ||
String toString() { | ||
"toString_for_non_auditable_${foo}_${bar}" | ||
} | ||
|
||
static constraints = { | ||
} | ||
|
||
static mapping = { | ||
id composite: ['foo', 'bar'] | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
examples/audit-test/grails-app/domain/test/TestEntity.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package test | ||
|
||
import grails.plugins.orm.auditable.Auditable | ||
|
||
@SuppressWarnings("GroovyUnusedDeclaration") | ||
class TestEntity implements Auditable { | ||
String property | ||
String otherProperty | ||
String anotherProperty | ||
|
||
// Just for testing | ||
Serializable ident() { | ||
"id" | ||
} | ||
|
||
@Override | ||
String toString() { | ||
property | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters