Git Product home page Git Product logo

socker-simple's Introduction

A basic model for "social kernel" database and back-end, to be implemented with relational-JSON persistence (PostgreSQL 9.6+) and Java Spring-Boot framework... Testing limits of the Object-Relational mapping, semantic mapping, and showing best practices.

It is a simple model of an usual database: a person+organization contact catalogue (the core of any CRM)... With precise information and a RDF semantic. The basic entities are defined in SchemaOrg:

Expanding: see Place and Agent-Agent relationships at SocKer-complete project, less didactic model but near to practical use.

Objective

To implement this model with good Java and good SQL,

And used as starting point (compatible) for SocKer-complete project.

Methodology

The aim is to obtain both, good Java and good SQL.

  1. Try with Spring Roo base-dbre (reverse engineer), usign step1.sql as reference... Is ok?

  2. Try with full construction by Spring Roo (as samples do)... Is Ok?

  3. Try "by hand" Spring Boot development.

Preparing and working

Supposing a prepared env with PostgreSQL, Roo1 and Roo2, the first step is to obtain a sample of the database, defined in step1.sql:

cd ~
git clone https://github.com/ppKrauss/socKer.git
cd socKer
psql -h localhost -U postgres postgres < step1.sql

roo1try1

Using Roo1 as command roo and the project's folder /roo1try1, to try method-1:

cd roo1try1
roo < step1.roo

As another Roo1 projects, need to edit conection, eg. with nano src/main/resources/META-INF/spring/database.properties adding the lines of spring.jpa,

spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.hibernate.ddl-auto=create-drop

To test and log the database introspection, run roo < step2.roo > logIntrospect.txt... Where we can see the first problem with Roo1, that not recognizes the commom sequences of IDs in the tables person and organization (see socker.agent_id_seq at database). We will try to correct this problem "by hand" later, let's check what Roo1 can do with all schema with database reverse engineer command in step3,

roo < step3.roo > step3.log

roo1try2

...

roo2try2

...

RESULTS

See all dumps at DUMPs folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.