This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package yourpackage.app; | |
| import com.cloudinary.Cloudinary; | |
| import com.cloudinary.SingletonManager; | |
| import com.cloudinary.utils.ObjectUtils; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.scheduling.annotation.EnableScheduling; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.deb.qbe.model; | |
| @Entity | |
| @Table(name = "customers") | |
| @Data | |
| @NoArgsConstructor | |
| @AllArgsConstructor | |
| @EqualsAndHashCode | |
| @ToString | |
| @Builder | |
| public class Customers implements Serializable{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface BookQueryService { | |
| Page<Book> findBookNoCriteria(Integer page,Integer size); | |
| Page<Book> findBookCriteria(Integer page,Integer size,BookQuery bookQuery); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 " + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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<>(); | |
| ... |
NewerOlder