New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

com.json4orm:json4orm-parent

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.json4orm:json4orm-parent

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.

  • 1.0.1
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

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.

FAQs

Package last updated on 09 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc