Skip to content

Instantly share code, notes, and snippets.

result = [];
function load(url, level)
{
console.log("level: "+level+","+url);
$.get(url, function(data, status){
var x;
if($(data).length>2)
{
x=$($(data)[2]);
public static void main(String[] args) {
try {
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300));
String jsonObject = "{\"age\":14,\"dateOfBirth\":1471466076564,"
+"\"fullName\":\"John Doe\"}";
IndexResponse response = client.prepareIndex("people", "Doe")
.setSource(jsonObject, XContentType.JSON).get();
@ledangtuanbk
ledangtuanbk / install-docker.sh
Last active March 26, 2019 03:52
install docker and docker compose
Install Docker & Docker Compose - Centos 7
Step 1 — Install Docker
Install needed packages:
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Configure the docker-ce repo:
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install docker-ce:
FROM mhart/alpine-node
RUN yarn global add serve
WORKDIR /app
COPY build .
CMD ["serve", "-p", "80", "-s", "."]
# Ignore everything
**
# Allow files and directories
!build/**
package com.ldt.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TestMain2 {
public static void main(String[] args) {
int[][] datas = new int[][]{
1. JPA Java Persistence API provides a specification for persisting, reading and managing data from your java object to relational tables in database
2. Hibernate is an object ralational mapping solution for java enviroments. ORM is a programming technique to map application domain model objects to relational database tables;
Hibernate provides a reference implementation of Java Persistence API that make it a greate choice as ORM tools with benefit of loose coupling.
Note that JPA is a specification and Hibernate is a JPA provider of implementation.
3. Spring Data is a part of the Spring Framework. The goal of Spring Data repository abstraction is reduce amount of
boilerplate code requited to implement data access layer.
1. jpa-entity-class
- @javax.persistance.Entity
- public, protected no-argument contructor
- class not declare final, no method, persistence instance variables is final.
- if an entity is passed by value as detached object. such as through a session bean remote. class must by implementaion Serialization
- Entity may extends both entity and non-entity class.
- fields: not annotated
version: '3'
services:
kong-migrations:
image: "${KONG_DOCKER_TAG:-kong:latest}"
command: kong migrations bootstrap
environment:
KONG_DATABASE: postgres
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong}
KONG_PG_HOST: 10.148.0.27
KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong}
SessionFactory
Session
Transaction
ConnectionProvider
Transaction Factory