This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
| First, install nginx for mac with "brew install nginx". | |
| Then follow homebrew's instructions to know where the config file is. | |
| 1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self | |
| 2. Copy it somewhere (use full path in the example below for server.* files) | |
| 3. sudo nginx -s reload | |
| 4. Access https://localhost/ | |
| Edit /usr/local/etc/nginx/nginx.conf: |
| @Entity | |
| public class Parent implements Serializable { | |
| @Id | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| private Long id; | |
| @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true) | |
| private Set<Child> children = new HashSet<>(); | |
| ... |
| public interface DataArticleRepository extends CrudRepository<Article, UUID> { | |
| Optional<Article> findBySlug(String slug); | |
| Optional<Article> findByTitle(String title); | |
| @Query("SELECT DISTINCT article_ FROM Article article_ " + | |
| "LEFT JOIN article_.tags t " + | |
| "LEFT JOIN article_.author p " + | |
| "LEFT JOIN article_.favoredUsers f " + |
| public interface BookQueryService { | |
| Page<Book> findBookNoCriteria(Integer page,Integer size); | |
| Page<Book> findBookCriteria(Integer page,Integer size,BookQuery bookQuery); | |
| } |
| package com.ypc.spring.data.elastic; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| @SpringBootApplication | |
| public class ElasticApplication { | |
| public static void main(String[] args) { | |
| SpringApplication.run(ElasticApplication.class, args); |
| package com.deb.qbe.model; | |
| @Entity | |
| @Table(name = "customers") | |
| @Data | |
| @NoArgsConstructor | |
| @AllArgsConstructor | |
| @EqualsAndHashCode | |
| @ToString | |
| @Builder | |
| public class Customers implements Serializable{ |
| package com.in28minutes.jpa.hibernate.demo.repository; | |
| import java.util.List; | |
| import javax.persistence.EntityManager; | |
| import javax.persistence.TypedQuery; | |
| import javax.persistence.criteria.CriteriaBuilder; | |
| import javax.persistence.criteria.CriteriaQuery; | |
| import javax.persistence.criteria.Join; | |
| import javax.persistence.criteria.JoinType; |
| public interface MemberRepository extends JpaRepository<SpringMember, Integer> { | |
| SpringMember findBySeqAndName(int seq, String name); | |
| List<SpringMember> findTop3ByNameLike(String name); | |
| SpringMember readBySeq(int seq); | |
| SpringMember readByName(String name); |
| package com.pig.jpa.hibernate.demo.repository; | |
| import java.util.List; | |
| import javax.persistence.EntityManager; | |
| import javax.persistence.Query; | |
| import javax.persistence.TypedQuery; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; |