Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for MongoDB 3.4 big decimals. Fixes grails/grails-data-mappin…
- Loading branch information
1 parent
a226006
commit e536ef4
Showing
12 changed files
with
167 additions
and
8 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
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
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
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
36 changes: 36 additions & 0 deletions
36
...astore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/BigDecimalSpec.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,36 @@ | ||
package org.grails.datastore.gorm.mongo | ||
|
||
import grails.gorm.annotation.Entity | ||
import grails.gorm.tests.GormDatastoreSpec | ||
import grails.mongodb.MongoEntity | ||
import groovy.transform.NotYetImplemented | ||
import org.bson.Document | ||
import org.bson.types.Decimal128 | ||
import spock.lang.Ignore | ||
import spock.lang.IgnoreIf | ||
|
||
/** | ||
* Created by graemerocher on 14/12/16. | ||
*/ | ||
class BigDecimalSpec extends GormDatastoreSpec { | ||
|
||
void "test save and retrieve big decimal value"() { | ||
when:"A big decimal is saved" | ||
def val = new BigDecimal("1.0") | ||
new BossMan(salary: val).save(flush:true) | ||
session.clear() | ||
BossMan bm = BossMan.first() | ||
then:"" | ||
bm.salary == val | ||
|
||
} | ||
|
||
@Override | ||
List getDomainClasses() { | ||
[BossMan] | ||
} | ||
} | ||
@Entity | ||
class BossMan implements MongoEntity<BossMan> { | ||
BigDecimal salary | ||
} |
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