yoda-orm


License

License

MIT
Categories

Categories

ORM Data
GroupId

GroupId

in.norbor
ArtifactId

ArtifactId

yoda-orm_2.13
Last Version

Last Version

20201022.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.13

How to add to project

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

Dependencies

compile (7)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.2
com.zaxxer : HikariCP jar 3.4.5
com.typesafe : config jar 1.4.0
com.typesafe.scala-logging : scala-logging_2.13 jar 3.9.2
in.norbor : yoda-common_2.13 jar 20200331
joda-time : joda-time jar 2.10.6
org.apache.velocity : velocity jar 1.7

test (3)

Group / Artifact Type Version
com.h2database : h2 jar 1.4.200
org.scalatest : scalatest_2.13 jar 3.1.1
org.postgresql : postgresql jar 42.2.11

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
20201022.1
20200331
5.1.0
5.0.0
4.1.0
4.0.9
4.0.8
4.0.4
4.0.0