No-args constructor in Scala for Morphia Morphia (like Hibernate) requires a no-args constructor for instantiating objects. Here's how to do it in Scala, while keeping your proper constructor with arguments. 1 2 3 4 5 6 7 8 9 10 11 12
MI CHAŁ HUNI E WI CZ ? import com.google.code.morphia.annotations.Entity import com.google.code.morphia.annotations.Indexes import com.google.code.morphia.annotations.Index Michał Huniewicz is a software engineer, currently living in England. @Entity V I E W MY CO MP L E TE P RO FI L E @Indexes(Array(new Index(value = "name, albumName, artistName, songKey" class MongoDbSong(val name: String, val albumName // No-args constructor to be used by Morphia. FO L L O WE RS def this() { this("name to be set", "albumName to be set" }
P O S TE D B Y MI CHA Ł HUNI E WI CZ A T 5 : 3 3 P M L A B E L S : MO RP HI A , P RO G RA MMI NG , S CA L A
2016 (3) 2015 (10) 2014 (6) 2013 (19) t 2012 (33) December (1) November (1) October (1) t September (8) CDI @Produces not working? Photos from Fez, Morocco Arquillian and @Asynchronous Morphia and semicolons Search in Git MongoDB with Morphia (and Scala) No-args constructor in Scala for Morphia Berlin 2012 - my photos August (3) July (2) June (1) May (4) April (8) March (1) February (1) January (2) 2011 (27) 2010 (53)