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.

Лицензия

Лицензия

Категории

Категории

JSON Данные ORM
Группа

Группа

com.json4orm
Идентификатор

Идентификатор

json4orm-core
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

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.

Скачать json4orm-core

Как подключить последнюю версию

<!-- 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"]

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
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)

Идентификатор библиотеки Тип Версия
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

Модули Проекта

Данный проект не имеет модулей.

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.

Версии библиотеки

Версия
1.0.1
1.0.0