This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Person extends Entity { | |
var name: String | |
def nameAsUpperCase = | |
name.toUpperCase | |
} | |
object Person { | |
def personsWhereNameStartsWith(string: String) = | |
select[Person] where (_.name like string + "%") | |
} | |
class NaturalPerson(var name: String, var motherName: String) extends Person { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nolan | |
import net.fwbrasil.activate.ActivateContext | |
import net.fwbrasil.activate.migration.Migration | |
import net.fwbrasil.activate.storage.mongo.MongoStorage | |
object MongoContext extends ActivateContext { | |
def contextName = "mongoContext" | |
val storage = new MongoStorage { | |
override val authentication = Option(("activate_test", "activate_test")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
class PrevaylerJr[T <: Serializable](initialState: T, pStorageFile: File) { | |
private val storageFile = new File(pStorageFile.getAbsolutePath + ".tmp") | |
private val system = { | |
val fileToRead = if (pStorageFile.exists) pStorageFile else storageFile | |
if (fileToRead.exists) { | |
val input = new ObjectInputStream(new FileInputStream(fileToRead)) |
NewerOlder