Any idea how to build SORM for scala 2.10.1 I am trying to generate a jar file that I can use in my eclipse project.
Here is my code
import sorm._
case class Coffee(name: String, supplier: Supplier, price: Double, sales: Int, total: Int)
case class Supplier(name: String, street: String, city: String, state: String, zip: String)
object Db extends Instance(
entities = Set(Entity[Coffee](),Entity[Supplier])),url="jdbc:mysql://localhost:3306/db123")
object sormtest {
import Db._
def main(args: Array[String]): Unit = {
val supplier1 = Supplier("Acme, Inc.", "99 Market Street", "Groundsville", "CA", "95199")
val supplier2 = Supplier("Superior Coffee", "1 Party Place", "Mendocino", "CA", "95460")
val supplier3 = Supplier("The High Ground", "100 Coffee Lane", "Meadows", "CA", "93966")
Db.save(supplier2) }}`
I am getting the following error :
Exception in thread "main" java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/impl/AbstractPoolBackedDataSource
at sorm.core.Connector.<init>(Connector.scala:16)
at sorm.Instance$Initialization.<init>(Instance.scala:209)
at sorm.Instance.<init>(Instance.scala:29)
at Db$.<init>(sormtest.scala:8)
at Db$.<clinit>(sormtest.scala)
at sormtest$.main(sormtest.scala:27)
at sormtest.main(sormtest.scala)
Caused by: java.lang.ClassNotFoundException: com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
I have already downloaded the jar file from here http://mvnrepository.com/artifact/org.sorm-framework/sorm/0.3.8
EDIT: The Maven repository lists a number of jar files to be included. Once I added them that solved my problem.
There is no need to build it yourself, SORM 0.3.8 is available on Maven Central, and supports Scala 2.10.x.
SBT:
libraryDependencies += "org.sorm-framework" % "sorm" % "0.3.8"
Maven:
<dependency>
<groupId>org.sorm-framework</groupId>
<artifactId>sorm</artifactId>
<version>0.3.8</version>
</dependency>
If you really want the JAR, you can download it from there too.