I am using java API that looks like:
import com.google.code.morphia.Morphia;
.....
val morphia = new Morphia();
morphia.map(Hotel.class).map(Address.class);
but it gives scala compiler error. what is the correct code in scala for above? Note that .map is defined as part of morphia API and not to be confused with scala map.
Assuming your problem is with the .class
parts, the Scala equivalent of Hotel.class
would be classOf[Hotel]
, likewise for Address
.
Hopefully this should fix your problem, although it's hard to tell without seeing the full compiler output.
You should use classOf[Hotel]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With