yoda-orm


License

License

MIT
Categories

Categories

ORM Data
GroupId

GroupId

in.norbor
ArtifactId

ArtifactId

yoda-orm_2.12
Last Version

Last Version

4.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

yoda-orm
yoda-orm
Project URL

Project URL

https://github.com/nuboat/yoda-orm
Project Organization

Project Organization

in.norbor
Source Code Management

Source Code Management

https://github.com/nuboat/yoda-orm

Download yoda-orm_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/in.norbor/yoda-orm_2.12/ -->
<dependency>
    <groupId>in.norbor</groupId>
    <artifactId>yoda-orm_2.12</artifactId>
    <version>4.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/in.norbor/yoda-orm_2.12/
implementation 'in.norbor:yoda-orm_2.12:4.0.1'
// https://jarcasting.com/artifacts/in.norbor/yoda-orm_2.12/
implementation ("in.norbor:yoda-orm_2.12:4.0.1")
'in.norbor:yoda-orm_2.12:jar:4.0.1'
<dependency org="in.norbor" name="yoda-orm_2.12" rev="4.0.1">
  <artifact name="yoda-orm_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='in.norbor', module='yoda-orm_2.12', version='4.0.1')
)
libraryDependencies += "in.norbor" % "yoda-orm_2.12" % "4.0.1"
[in.norbor/yoda-orm_2.12 "4.0.1"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.8
com.zaxxer : HikariCP jar 3.3.1
com.typesafe : config jar 1.3.4
com.typesafe.scala-logging : scala-logging_2.12 jar 3.9.2
joda-time : joda-time jar 2.10.2
org.apache.velocity : velocity jar 1.7

test (3)

Group / Artifact Type Version
com.h2database : h2 jar 1.4.199
org.scalatest : scalatest_2.12 jar 3.1.0-SNAP13
org.postgresql : postgresql jar 42.2.5

Project Modules

There are no modules declared in this project.

YODA - ORM

Simple Scala case class ORM,

sbt publishM2
sbt publishLocal
sbt publishSigned
sbt sonatypeRelease
sbt "sonatypeRelease innorbor-xxxx"

sbt sonatypeList
sbt sonatypeClose
sbt sonatypeDrop
``

BTW, This project is completely opensource and feel free to PR


Compare: PreparedStatement and PStatement
========

```PrepareStatement
    val preparedStatement = conn.prepareStatement(FIND)
    preparedStatement.setLong(1, id)
    preparedStatement.setString(2, status)
    preparedStatement.setDateTime(3, yesterday)
    
    val rs = preparedStatement.executeQuery()

    val (id1, status1, yesterday1) = (rs.getLong(1)
        , rs.getString(2)
        , rs.getTimeStamp(3))
    FIND : SELECT * FROM people where id = 1s
    
    val result = PStatement(FIND)
      .setLong(id)
      .setString(status)
      .setDateTime(yesterday)
      .queryOne(rs => (rs.getLong(1)
        , rs.getString(2)
        , rs.getDateTime(3)
      ) 

    case class People(id: Long, name: String, born: DateTime)
    
    val people = PStatement(FIND)
      .setLong(id)
      .queryOne[People]
      
    val peoples = PStatement(FIND)
      .setLong(id)
      .queryList[People]
      
    
    import in.norbor.yoda.orm.JavaSqlImprovement
      
    val peoples = PStatement(FIND)
      .setLong(id)
      .queryOne( (rs) => People(id = rs.getLong("id")
        , name = rs.getLong("name")
        , boar = rs.getDateTime("born")
      )
      
    val peoples = PStatement(FIND)
      .setLong(id)
      .queryList( (rs) => People(id = rs.getLong("id")
        , name = rs.getLong("name")
        , boar = rs.getDateTime("born")
      )
    val g = Generator()
    implicit val target: String = "target"

    g.gen[Customer](table = "customer", idName = "id", idType = "String")

For fully documents, Please looking from /src/test/scala

Copyright (c) 2020. Peerapat Asoktummarungsri https://www.linkedin.com/in/peerapat

Versions

Version
4.0.1
3.3.9
3.3.8
3.3.7
3.3.6
3.3.5b
3.3.5
3.3.4b
3.3.3b
3.3.1b
3.3.0b
3.2.2
3.2.1
3.2.0
3.1.1
3.1.0
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.5.0
2.4.0
2.3.2
2.3.1
2.3.0
2.2.1
2.1.0
2.0
1.5.0
1.4.0