skinny.orm

SkinnyRecord

trait SkinnyRecord[Entity] extends SkinnyRecordWithId[Long, Entity]

ActiveRecord::Base-like entity object base.

case class Company(id: Long, name: String) extends SkinnyResource[Company] {
  def skinnyCRUDMapper = Company
}
object Company extends SkinnyCRUDMapper[Long, Company] {
  def extract(rs: WrappedResultSet, s: ResultName[Company]): Company = new Company(
    id = rs.longOpt(s.id),
    name = rs.string(s.name)
  )
}
// usage
val company = Company.findById(id).get
company.copy(name = "Oracle").save()
company.destroy()
Entity

entity

Linear Supertypes
SkinnyRecordWithId[Long, Entity], SkinnyRecordBaseWithId[Long, Entity], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SkinnyRecord
  2. SkinnyRecordWithId
  3. SkinnyRecordBaseWithId
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def id: Long

    Id as the primary key.

    Id as the primary key.

    If your entity's primary key is not single numeric value, implement this method as a dummy(e.g. UnsupportedOperationException) override #primaryKeyCondition.

    returns

    id

    Definition Classes
    SkinnyRecordWithIdSkinnyRecordBaseWithId
  2. abstract def skinnyCRUDMapper: CRUDFeatureWithId[Long, Entity]

    Returns skinny.orm.SkinnyCRUDMapperWithId for this SkinnyRecord.

    Returns skinny.orm.SkinnyCRUDMapperWithId for this SkinnyRecord.

    returns

    mapper

    Definition Classes
    SkinnyRecordBaseWithId

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def attributesToPersist(): Seq[(scalikejdbc.SQLSyntax, Any)]

    Returns attributes to persist.

    Returns attributes to persist.

    returns

    attributes

    Attributes
    protected
    Definition Classes
    SkinnyRecordBaseWithId
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def destroy()(implicit session: DBSession = skinnyCRUDMapper.autoSession): Int

    Destroys this entity in DB.

    Destroys this entity in DB.

    session

    db session

    returns

    deleted count

    Definition Classes
    SkinnyRecordBaseWithId
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def excludedFieldNamesWhenSaving: Seq[String]

    Returns attribute names to be excluded when persistence.

    Returns attribute names to be excluded when persistence.

    returns

    names

    Attributes
    protected
    Definition Classes
    SkinnyRecordBaseWithId
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def save()(implicit session: DBSession = skinnyCRUDMapper.autoSession): SkinnyRecordBaseWithId[Long, Entity]

    Saves this instance in DB.

    Saves this instance in DB. Notice: this methods only can update existing entity.

    session

    db session

    returns

    self

    Definition Classes
    SkinnyRecordBaseWithId
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from SkinnyRecordWithId[Long, Entity]

Inherited from SkinnyRecordBaseWithId[Long, Entity]

Inherited from AnyRef

Inherited from Any

Ungrouped