当前位置: 首页>>代码示例>>Scala>>正文


Scala ResultSet类代码示例

本文整理汇总了Scala中com.datastax.driver.core.ResultSet的典型用法代码示例。如果您正苦于以下问题:Scala ResultSet类的具体用法?Scala ResultSet怎么用?Scala ResultSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ResultSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。

示例1: GenderServiceImpl

//设置package包名称以及导入依赖的类
package services.common.demographics.Impl

import com.datastax.driver.core.ResultSet
import domain.common.demographics.Gender
import repositories.common.demographics.GenderRepository
import services.Service
import services.common.demographics.GenderService

import scala.concurrent.Future


class GenderServiceImpl extends GenderService with Service{

  override def createOrUpdate(gender: Gender): Future[ResultSet] = {
    GenderRepository.save(gender)
  }

  override def getGenderById(id: String): Future[Option[Gender]] = {
    GenderRepository.getGenderById(id)
  }

  override def getGenders(id: String): Future[Seq[Gender]] = {
    GenderRepository.getGenders(id)
  }
} 
开发者ID:Masebeni,项目名称:hwork,代码行数:26,代码来源:GenderServiceImpl.scala

示例2: ApiKeysRepository

//设置package包名称以及导入依赖的类
package repository.util

import com.datastax.driver.core.{ResultSet, Row}
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.dsl._
import com.websudos.phantom.iteratee.Iteratee
import com.websudos.phantom.keys.PartitionKey
import conf.connection.DataConnection
import domain.util.ApiKeys

import scala.concurrent.Future


class ApiKeysRepository extends CassandraTable[ApiKeysRepository, ApiKeys] {

  object id extends StringColumn(this) with PartitionKey[String]

  object value extends StringColumn(this)

  override def fromRow(row: Row): ApiKeys = {
    ApiKeys(
      id(row),
      value(row)
    )
  }
}

object ApiKeysRepository extends ApiKeysRepository with RootConnector {
  override lazy val tableName = "apikeys"

  override implicit def space: KeySpace = DataConnection.keySpace

  override implicit def session: Session = DataConnection.session


  def save(key: ApiKeys): Future[ResultSet] = {
    insert
      .value(_.id, key.id)
      .value(_.value, key.value)
      .future()
  }

  def getKeyById(id: String): Future[Option[ApiKeys]] = {
    select.where(_.id eqs id).one()
  }

  def getAllkeys: Future[Seq[ApiKeys]] = {
    select.fetchEnumerator() run Iteratee.collect()
  }

  def deleteKey(id: String): Future[ResultSet] = {
    delete.where(_.id eqs id).future()
  }
} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:55,代码来源:ApiKeysRepository.scala

示例3: TokenRepository

//设置package包名称以及导入依赖的类
package repository.util

import com.datastax.driver.core.{ResultSet, Row}
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.dsl._
import com.websudos.phantom.keys.PartitionKey
import conf.connection.DataConnection
import domain.util.Token

import scala.concurrent.Future


class TokenRepository extends CassandraTable[TokenRepository, Token] {

  object id extends StringColumn(this) with PartitionKey[String]

  object tokenValue extends StringColumn(this)

  override def fromRow(row: Row): Token = {
    Token(
      id(row),
      tokenValue(row)
    )
  }
}

object TokenRepository extends TokenRepository with RootConnector {
  override lazy val tableName = "tokens"

  override implicit def space: KeySpace = DataConnection.keySpace

  override implicit def session: Session = DataConnection.session


  def save(token: Token): Future[ResultSet] = {
    insert
      .value(_.id, token.id)
      .value(_.tokenValue, token.tokenValue)
      .ttl(12000)
      .future()
  }

  def getTokenById(id:String):Future[Option[Token]] = {
    select.where(_.id eqs id).one()

  }
  def deleteToken(id:String): Future[ResultSet] = {
    delete.where(_.id eqs id).future()
  }

} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:52,代码来源:TokenRepository.scala

示例4: KeysRepository

//设置package包名称以及导入依赖的类
package repository.util

import com.datastax.driver.core.{ResultSet, Row}
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.dsl._
import com.websudos.phantom.iteratee.Iteratee
import com.websudos.phantom.keys.PartitionKey
import conf.connection.DataConnection
import domain.util.Keys

import scala.concurrent.Future


sealed class KeysRepository extends CassandraTable[KeysRepository, Keys] {

  object id extends StringColumn(this) with PartitionKey[String]

  object value extends StringColumn(this)

  override def fromRow(row: Row): Keys = {
    Keys(
      id(row),
      value(row)
    )
  }
}

object KeysRepository extends KeysRepository with RootConnector {
  override lazy val tableName = "tokenkeys"

  override implicit def space: KeySpace = DataConnection.keySpace

  override implicit def session: Session = DataConnection.session


  def save(key: Keys): Future[ResultSet] = {
    insert
      .value(_.id, key.id)
      .value(_.value, key.value)
      .future()
  }
  def getKeyById(id: String): Future[Option[Keys]] = {
    select.where(_.id eqs id).one()
  }
  def getAllkeys: Future[Seq[Keys]] = {
    select.fetchEnumerator() run Iteratee.collect()
  }

  def deleteKey(id:String) : Future[ResultSet]={
    delete.where(_.id eqs id).future()
  }
} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:53,代码来源:KeysRepository.scala

示例5: ApiKeysService

//设置package包名称以及导入依赖的类
package services.util

import com.datastax.driver.core.ResultSet
import domain.util.ApiKeys
import repository.util.ApiKeysRepository
import services.Service

import scala.concurrent.Future


object ApiKeysService extends Service{
  def saveOrUpdate(entity: ApiKeys): Future[ResultSet] = {
    ApiKeysRepository.save(entity)
  }
  def get(id:String):Future[Option[ApiKeys]] ={
    ApiKeysRepository.getKeyById(id)
  }

  def getAll:Future[Seq[ApiKeys]] ={
    ApiKeysRepository.getAllkeys
  }

} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:24,代码来源:ApiKeysService.scala

示例6: StatusService

//设置package包名称以及导入依赖的类
package services.util

import com.datastax.driver.core.ResultSet
import domain.util.Status
import repository.util.StatusRepository
import services.Service

import scala.concurrent.Future


object  StatusService extends Service{
  def saveOrUpdate(entity: Status): Future[ResultSet] = {
    StatusRepository.save(entity)
  }
  def get(id:String):Future[Option[Status]] ={
    StatusRepository.findById(id)
  }

  def getAll:Future[Seq[Status]] ={
    StatusRepository.findAll
  }

} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:24,代码来源:StatusService.scala

示例7: PersonEventsService

//设置package包名称以及导入依赖的类
package services.persons

import com.datastax.driver.core.ResultSet
import domain.persons.PersonEvents
import repository.persons.PersonEventsRepository
import services.Service

import scala.concurrent.Future


object PersonEventsService extends Service{
  def saveOrUpdate(entity: PersonEvents): Future[ResultSet] = {
    PersonEventsRepository.save(entity)
}

  def getValues(personId: String): Future[Seq[PersonEvents]] = {
    PersonEventsRepository.findPersonEvents(personId)
}

  def getPersonValue(personId: String, id: String): Future[Option[PersonEvents]] = {
    PersonEventsRepository.findById(personId, id)
  }
} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:24,代码来源:PersonEventsService.scala

示例8: PersonService

//设置package包名称以及导入依赖的类
package services.persons

import com.datastax.driver.core.ResultSet
import domain.persons.Person
import repository.persons.{UsersRepository, PersonRepository}
import services.Service

import scala.concurrent.Future


object PersonService extends Service{

  def saveOrUpdate(entity: Person): Future[ResultSet] = {

    PersonRepository.save(entity)
  }
  def getPeople(id:String):Future[Seq[Person]] ={
    PersonRepository.findPeople(id)
  }

  def getPerson(orgId:String,id:String):Future[Option[Person]] ={
    PersonRepository.findPerson(orgId,id)
  }
  def getPersonByEmail(email:String):Future[Option[Person]] = {
    UsersRepository.findByEmail(email)
  }

} 
开发者ID:Thulebona,项目名称:hashpvtapi,代码行数:29,代码来源:PersonService.scala

示例9: ApiKeysRepository

//设置package包名称以及导入依赖的类
package repositories.common.util

import com.datastax.driver.core.{ResultSet, Row}
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.dsl._
import com.websudos.phantom.keys.PartitionKey
import com.websudos.phantom.reactivestreams._
import conf.connection.DataConnection
import domain.common.util.ApiKeys

import scala.concurrent.Future


class ApiKeysRepository extends CassandraTable[ApiKeysRepository, ApiKeys] {

  object id extends StringColumn(this) with PartitionKey[String]

  object value extends StringColumn(this)

  override def fromRow(row: Row): ApiKeys = {
    ApiKeys(
      id(row),
      value(row)
    )
  }
}

object ApiKeysRepository extends ApiKeysRepository with RootConnector {
  override lazy val tableName = "apikeys"

  override implicit def space: KeySpace = DataConnection.keySpace

  override implicit def session: Session = DataConnection.session


  def save(key: ApiKeys): Future[ResultSet] = {
    insert
      .value(_.id, key.id)
      .value(_.value, key.value)
      .future()
  }

  def getKeyById(id: String): Future[Option[ApiKeys]] = {
    select.where(_.id eqs id).one()
  }

  def getAllkeys: Future[Seq[ApiKeys]] = {
    select.fetchEnumerator() run Iteratee.collect()
  }

  def deleteKey(id: String): Future[ResultSet] = {
    delete.where(_.id eqs id).future()
  }
} 
开发者ID:boniface,项目名称:hworkapi,代码行数:55,代码来源:ApiKeysRepository.scala

示例10: TokenRepository

//设置package包名称以及导入依赖的类
package repositories.common.util

import com.datastax.driver.core.{ResultSet, Row}
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.dsl._
import com.websudos.phantom.keys.PartitionKey
import conf.connection.DataConnection
import domain.common.util.Token

import scala.concurrent.Future


class TokenRepository extends CassandraTable[TokenRepository, Token] {

  object id extends StringColumn(this) with PartitionKey[String]

  object tokenValue extends StringColumn(this)

  override def fromRow(row: Row): Token = {
    Token(
      id(row),
      tokenValue(row)
    )
  }
}

object TokenRepository extends TokenRepository with RootConnector {
  override lazy val tableName = "tokens"

  override implicit def space: KeySpace = DataConnection.keySpace

  override implicit def session: Session = DataConnection.session


  def save(token: Token): Future[ResultSet] = {
    insert
      .value(_.id, token.id)
      .value(_.tokenValue, token.tokenValue)
      .ttl(12000)
      .future()
  }

  def getTokenById(id:String):Future[Option[Token]] = {
    select.where(_.id eqs id).one()

  }
  def deleteToken(id:String): Future[ResultSet] = {
    delete.where(_.id eqs id).future()
  }

} 
开发者ID:boniface,项目名称:hworkapi,代码行数:52,代码来源:TokenRepository.scala

示例11: CompanyContactsService

//设置package包名称以及导入依赖的类
package services.companycontacts

import com.datastax.driver.core.ResultSet
import domain.companycontacts.CompanyContacts
import repository.contacts.ContactsRepository
import services.Service

import scala.concurrent.Future


object CompanyContactsService extends Service {

  def saveOrUpdate(entity: CompanyContacts): Future[ResultSet] = {
    ContactsRepository.save(entity)
  }
  def findById(company: String, entityId:String, id: String):Future[Option[CompanyContacts]] ={
    ContactsRepository.findById(company,entityId,id)
  }

  def getAll(company:String):Future[Seq[CompanyContacts]] ={
    ContactsRepository.findAll(company)
  }

  def findEntityContacts(company: String, entityId:String): Future[Seq[CompanyContacts]] = {
    ContactsRepository.findEntityContacts(company,entityId)
  }

} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:29,代码来源:CompanyContactsService.scala

示例12: PersonRoleService

//设置package包名称以及导入依赖的类
package services.people

import com.datastax.driver.core.ResultSet
import domain.common.demographics.Gender
import domain.people.PersonRole
import repository.common.demographics.GenderRepository
import repository.people.PersonRoleRepository
import services.Service

import scala.concurrent.Future


object PersonRoleService extends Service {
  def saveOrUpdate(entity: PersonRole): Future[ResultSet] = {
    PersonRoleRepository.save(entity)
  }

  def get(id: String, roleId: String): Future[Option[PersonRole]] = {
    PersonRoleRepository.findRole(id, roleId)
  }

  def getAllRoles(personId: String): Future[Seq[PersonRole]] = {
    PersonRoleRepository.findRolesById(personId)
  }

} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:27,代码来源:PersonRoleService.scala

示例13: PeopleService

//设置package包名称以及导入依赖的类
package services.people

import com.datastax.driver.core.ResultSet
import domain.common.demographics.Gender
import domain.people.Person
import repository.common.demographics.GenderRepository
import repository.people.{UsersRepository, PersonRepository}
import services.Service

import scala.concurrent.Future


object PeopleService extends Service{

  def saveOrUpdate(entity: Person): Future[ResultSet] = {
    PersonRepository.save(entity)
  }
  def getPeople(id:String):Future[Seq[Person]] ={
    PersonRepository.findPeople(id)
  }

  def getPerson(company:String,id:String):Future[Option[Person]] ={
    PersonRepository.findPerson(company,id)
  }
  def getPersonByEmail(email:String):Future[Option[Person]] = {
    UsersRepository.findByEmail(email)
  }

} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:30,代码来源:PeopleService.scala

示例14: DepartmentService

//设置package包名称以及导入依赖的类
package services.company

import com.datastax.driver.core.ResultSet
import domain.common.demographics.Gender
import domain.company.{Department, Company}
import repository.common.demographics.GenderRepository
import repository.company.{DepartmentRepository, CompanyRepository}
import services.Service

import scala.concurrent.Future


object DepartmentService extends Service{

  def saveOrUpdate(entity: Department): Future[ResultSet] = {
    DepartmentRepository.save(entity)
  }
  def get(company:String, id:String):Future[Option[Department]] ={
    DepartmentRepository.findDepartment(company,id)
  }

  def getDepartments(company:String):Future[Seq[Department]] ={
    DepartmentRepository.findDepartments(company)
  }

} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:27,代码来源:DepartmentService.scala

示例15: AddressTypeService

//设置package包名称以及导入依赖的类
package services.common.location

import com.datastax.driver.core.ResultSet
import domain.common.demographics.Gender
import domain.common.location.AddressType
import repository.common.demographics.GenderRepository
import repository.common.location.AddressTypeRepository
import services.Service

import scala.concurrent.Future


object AddressTypeService extends Service{
  def saveOrUpdate(entity: AddressType): Future[ResultSet] = {
    AddressTypeRepository.save(entity)
  }
  def get(id:String):Future[Option[AddressType]] ={
    AddressTypeRepository.findById(id)
  }

  def getAll:Future[Seq[AddressType]] ={
    AddressTypeRepository.findAll
  }

} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:26,代码来源:AddressTypeService.scala


注:本文中的com.datastax.driver.core.ResultSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。