com.json4orm:json4orm-core

Json4orm introduces standard to map relational database tables and SQL queries using JSON objects. It offers APIs to query data based on JSON orm mappings and queries.

License

License

Categories

Categories

JSON Data ORM
GroupId

GroupId

com.json4orm
ArtifactId

ArtifactId

json4orm-core
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Json4orm introduces standard to map relational database tables and SQL queries using JSON objects. It offers APIs to query data based on JSON orm mappings and queries.

Download json4orm-core

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-core jar 2.10.1
com.fasterxml.jackson.core : jackson-databind jar 2.10.1
com.fasterxml.jackson.core : jackson-annotations jar 2.10.1
org.apache.commons : commons-lang3 jar 3.9
org.apache.logging.log4j : log4j-api jar 2.12.1
org.apache.logging.log4j : log4j-core jar 2.12.1

test (10)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19
org.powermock : powermock-core jar 1.7.4
org.powermock : powermock-api-mockito jar 1.7.4
org.powermock : powermock-api-support jar 1.7.4
org.powermock : powermock-classloading-xstream jar 1.7.4
org.powermock : powermock-module-junit4 jar 1.7.4
org.powermock : powermock-module-junit4-rule jar 1.7.4
org.powermock : powermock-module-junit4-rule-agent jar 1.7.4
xmlunit : xmlunit jar 1.6

Project Modules

There are no modules declared in this project.

Json4orm

Motivation

Make data in relational database searchable online and deliverable with customizable format, without programming.

Main Features

  • Support defining database object-relational mappings (ORMs) in JSON
  • Support defining database queries in JSON with customized fields to return as result
  • Support database query engine to execute queries defined in JSON based on ORMs defined in JSON

Quick Example

Entity Mapping

Student

#student.json
{
  name: "Student",
  table: "student",
  properties: [
    {
      name: "studentId",
      type: "ID",
      column: "student_id"
    },
    {
      name: "firstName",
      type: "string",
      column: "first_name"
    },
    {
      name: "lastName",
      type: "string",
      column: "last_name"
    },
    {
      name: "middleName",
      type: "string",
      column: "middle_name"
    },
    {
      name: "birthDate",
      type: "date",
      column: "birth_date"
    },
    {
      name: "createdAt",
      type: "timestamp",
      column: "created_at"
    }
  ]
}

Class

{
  name: "Class",
  table: "class",
  properties: [
    {
      name: "classId",
      type: "ID",
      column: "class_id"
    },
    {
      name: "name",
      type: "string",
      column: "name"
    },
    {
      name: "createdAt",
      type: "timestamp",
      column: "created_at"
    },
    {
      name: "classStudents",
      type: "list",
      column: "class_id",
      itemType: "ClassStudent"
    }
  ]
}

ClassStudent

{
  name: "ClassStudent",
  table: "class_student",
  properties: [
    {
      name: "classStudentId",
      type: "ID",
      column: "class_student_id"
    },
    {
      name: "class",
      type: "Class",
      column: "class_id"
    },
    {
      name: "student",
      type: "Student",
      column: "student_id"
    },
    {
      name: "score",
      type: "float",
      column: "score"
    },
    {
      name: "createdAt",
      type: "timestamp",
      column: "created_at"
    }
  ]
}

Query in Json

{
  queryFor: "Student",
  filter: {
    and: [
      {
         firstName: "John"
      },
      {
        "classStudents.class.name": {
           in: ["Math","English","History"]
        } 
      }
    ]   
  },
  result: {
    Student: {
      properties: ["firstName", "lastName","birthDate"],
      classStudents: {
        properties: ["classStudentId", "score"],
        class: ["name"]
      }
    }  
  }
}

User Guide and API Guide

Please visit http://json4orm.com for user guide and API guide.

Versions

Version
1.0.1
1.0.0