• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Scala ResultSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: LocationTypeService

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

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

import scala.concurrent.Future


object LocationTypeService extends Service{
  def saveOrUpdate(entity: LocationType): Future[ResultSet] = {
    LocationTypeRepository.save(entity)
  }
  def get(id:String):Future[Option[LocationType]] ={
    LocationTypeRepository.findById(id)
  }

  def getAll:Future[Seq[LocationType]] ={
    LocationTypeRepository.findAll
  }

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


示例17: ContactTypeService

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

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

import scala.concurrent.Future


object ContactTypeService extends Service {

  def saveOrUpdate(entity: ContactType): Future[ResultSet] = {
    ContactTypeRepository.save(entity)
  }
  def get(id:String):Future[Option[ContactType]] ={
    ContactTypeRepository.findById(id)
  }

  def getAll:Future[Seq[ContactType]] ={
    ContactTypeRepository.findAll
  }
} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:26,代码来源:ContactTypeService.scala


示例18: MaritalStatusService

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

import com.datastax.driver.core.ResultSet
import domain.common.demographics.{Gender, MaritalStatus}
import repository.common.demographics.{GenderRepository, MaritalStatusRepository}
import services.Service

import scala.concurrent.Future


object MaritalStatusService extends Service{
  def saveOrUpdate(entity: MaritalStatus): Future[ResultSet] = {
    MaritalStatusRepository.save(entity)
  }

  def get(id:String):Future[Option[MaritalStatus]] ={
    MaritalStatusRepository.findById(id)
  }

  def getAll:Future[Seq[MaritalStatus]] ={
    MaritalStatusRepository.findAll
  }
} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:24,代码来源:MaritalStatusService.scala


示例19: RaceService

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

import com.datastax.driver.core.ResultSet
import domain.common.demographics.{Gender, Race}
import repository.common.demographics.{GenderRepository, RaceRepository}
import services.Service

import scala.concurrent.Future


object RaceService extends Service{

  def saveOrUpdate(entity: Race): Future[ResultSet] = {
    RaceRepository.save(entity)
  }
  def get(id:String):Future[Option[Race]] ={
    RaceRepository.findById(id)
  }

  def getAll:Future[Seq[Race]] ={
    RaceRepository.findAll
  }
} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:24,代码来源:RaceService.scala


示例20: IdentificationTypeService

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

import com.datastax.driver.core.ResultSet
import domain.common.demographics.{Gender, IdentificationType}
import repository.common.demographics.{GenderRepository, IdentificationTypeRepository}
import services.Service

import scala.concurrent.Future


object IdentificationTypeService extends Service{

  def saveOrUpdate(entity: IdentificationType): Future[ResultSet] = {
    IdentificationTypeRepository.save(entity)
  }
  def get(id:String):Future[Option[IdentificationType]] ={
    IdentificationTypeRepository.findById(id)
  }

  def getAll:Future[Seq[IdentificationType]] ={
    IdentificationTypeRepository.findAll
  }
} 
开发者ID:roclet,项目名称:hashworkapi,代码行数:24,代码来源:IdentificationTypeService.scala



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Scala normalize类代码示例发布时间:2022-05-23
下一篇:
Scala SortedSet类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap