Skip to content

sak4/morphia_251_repro_float_lifecycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Possible issue with how floats are handled in Lifecycle events

Entity has a float field

  • Entity is annotated with Lifecycle Listeners (e.g. @PostPersist, @PreLoad)
  • In the Lifecycle methods, operations are performed that involve the float field (e.g. base64 encoding/decoding),
  • Since it is a numeric type, the PostPersist event converts it to a Base64 encoded String in the Document during persistence.
  • During Read, on the decoding side, the PreLoad event converts the Base64 encoded String back to a float.
  • It fails
  • A workaround is to use Double instead of float.

About

Float with lifecycle events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages