This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Announce: Activate Persistence Framework 0.6

No replies
fwbrasil
Joined: 2011-03-07,
User offline. Last seen 10 weeks 4 days ago.

Activate 0.6 is available. Main changes:

- Properties of entities no longer have to be declared as Var, using directly the desired types.
- Properties referencing abstract entities and queries about abstract entities.
- MongoDB storage.
- JodaTime dates and scala Enumerations properties.
- Various performance improvements and refactorings.

https://github.com/fwbrasil/activate

Examples using Activate:
abstract class Person(var name: String) extends Entity
class NaturalPerson(name: String, var motherName: String) extends Person(name)
class LegalPerson(name: String, var director: NaturalPerson) extends Person(name)
transactional {
    val person = new NaturalPerson("John", "Marie")
    person.name = "John2"
    println(person.name)
}
val q = query {
    (person: Person) => where(person.name :== "John2") select(person)
}
transactional {
    val result = q.execute
    for (person <- result)
        println(person.name)
}
transactional {
    val personList1 = all[Person]
    val personList2 = allWhere[NaturalPerson](_.name :== "Test", _.motherName :== "Mother")
}

-- 
Flávio W. Brasil
fwbrasil.net

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland