This is a basic tutorial on Spring core.
Best viewed when animations and transitions are supported, e.g., view in MS Powerpoint. So, please try to view it with animation else the main purpose of this presentation will be defeated.
This is a basic tutorial on Spring core.
Best viewed when animations and transitions are supported, e.g., view in MS Powerpoint. So, please try to view it with animation else the main purpose of this presentation will be defeated.
The java persistence API provides a specification for persisting, reading, and managing data from your java object to your relational tables in the database. JPA specifies the set of rules and guidelines for developing interfaces that follow standards.
In this session you will learn:
Understand Spring framework overview & its salient features
Spring concepts (IoC container / DI)
Spring-AOP basics
Spring ORM / Spring DAO overview
Spring Web / MVC overview
For more information, visit: https://www.mindsmapped.com/courses/software-development/java-developer-training-for-beginners/
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
Spring Data is a high level SpringSource project whose purpose is to unify and ease the access to different kinds of persistence stores, both relational database systems and NoSQL data stores.
Introduction to the Spring Framework:
Generar description
IoC container
Dependency Injection
Beans scope and lifecycle
Autowiring
XML and annotation based configuration
Additional features
Youtube Link: https://youtu.be/CXTiwkZVoZI
( Microservices Architecture Training: https://www.edureka.co/microservices-architecture-training )
This Edureka's PPT on Spring Boot Interview Questions talks about the top questions asked related to Spring Boot.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Java and Spring Data JPA: Easy SQL Data Access
Abstract
Presenter: Miya W. Longwe, MBA, MSE, Tech Lead, Staples, Inc, Framingham MA 01702
Accessing data repositories in various applications programming languages typically involves writing of tedious boilerplate lines of code. Some application development frameworks such as Spring have tried to make the experience more succinct by providing abstraction layers such as HibernateTemplate and JdbcTemplate, etc. Despite these APIs, the developers still spend a lot time writing repetitive code than concentrating on implementing business requirements. Developers at Spring, led by Oliver Gierke, introduced Spring Data JPA which “aims to significantly improve the implementation of data access layers by reducing the effort to the amount that's actually needed. As a developer you write your repository interfaces, including custom finder methods, and Spring will provide the implementation automatically”.
Spring Data JPA provides a powerful, out-of-the-box alternative to creating your own DAO framework. You declare custom repository operations on an interface, and the framework generates dynamic implementations (not code generation) automatically, based on conventions around method names. As part of the presentation, we'll also review a demo to look at Spring Java configuration (as opposed to XML configuration), and investigate the @Profile annotation – configuration details which may make life a bit easier in various ways when setting up unit testing of our repository classes, using out-of-the-box alternative to creating DAO framework, how to create custom repositories, pagination and support for custom queries among other features.
Presenter's Bio
Miya W. Longwe is a Senior Software Engineer and Tech Lead at Staples, Inc. where he is currently working on an initiative to re-platform the company’s ecommerce architecture to offer platform-driven, modular products that can be quickly customized, enhanced, and branded as needed.
Miya has been a software professional since 1997. His 16 years software development career includes working for large companies to small startups, building solutions for enterprises and consumers, working with a broad range of technologies.
Miya Longwe is a hands-on java developer. He believes that in order to be a relevant and effective software developer one needs to remain a deeply knowledgeable, up-to-date, and productive software developer. His research interests include model-driven engineering, domain specific languages, test driven development and project risk management.
Miya graduated from the University of Malawi (Lilongwe, Malawi) and has an MBA from the University of Wales Cardiff Business School (Wales, UK) and a Masters in Software Engineering from Brandeis University (MA, USA).
Occasionally, Miya can be spotted fishing the banks of the south shore (MA) with his two boys, William and Daniel.
The java persistence API provides a specification for persisting, reading, and managing data from your java object to your relational tables in the database. JPA specifies the set of rules and guidelines for developing interfaces that follow standards.
In this session you will learn:
Understand Spring framework overview & its salient features
Spring concepts (IoC container / DI)
Spring-AOP basics
Spring ORM / Spring DAO overview
Spring Web / MVC overview
For more information, visit: https://www.mindsmapped.com/courses/software-development/java-developer-training-for-beginners/
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
Spring Data is a high level SpringSource project whose purpose is to unify and ease the access to different kinds of persistence stores, both relational database systems and NoSQL data stores.
Introduction to the Spring Framework:
Generar description
IoC container
Dependency Injection
Beans scope and lifecycle
Autowiring
XML and annotation based configuration
Additional features
Youtube Link: https://youtu.be/CXTiwkZVoZI
( Microservices Architecture Training: https://www.edureka.co/microservices-architecture-training )
This Edureka's PPT on Spring Boot Interview Questions talks about the top questions asked related to Spring Boot.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Java and Spring Data JPA: Easy SQL Data Access
Abstract
Presenter: Miya W. Longwe, MBA, MSE, Tech Lead, Staples, Inc, Framingham MA 01702
Accessing data repositories in various applications programming languages typically involves writing of tedious boilerplate lines of code. Some application development frameworks such as Spring have tried to make the experience more succinct by providing abstraction layers such as HibernateTemplate and JdbcTemplate, etc. Despite these APIs, the developers still spend a lot time writing repetitive code than concentrating on implementing business requirements. Developers at Spring, led by Oliver Gierke, introduced Spring Data JPA which “aims to significantly improve the implementation of data access layers by reducing the effort to the amount that's actually needed. As a developer you write your repository interfaces, including custom finder methods, and Spring will provide the implementation automatically”.
Spring Data JPA provides a powerful, out-of-the-box alternative to creating your own DAO framework. You declare custom repository operations on an interface, and the framework generates dynamic implementations (not code generation) automatically, based on conventions around method names. As part of the presentation, we'll also review a demo to look at Spring Java configuration (as opposed to XML configuration), and investigate the @Profile annotation – configuration details which may make life a bit easier in various ways when setting up unit testing of our repository classes, using out-of-the-box alternative to creating DAO framework, how to create custom repositories, pagination and support for custom queries among other features.
Presenter's Bio
Miya W. Longwe is a Senior Software Engineer and Tech Lead at Staples, Inc. where he is currently working on an initiative to re-platform the company’s ecommerce architecture to offer platform-driven, modular products that can be quickly customized, enhanced, and branded as needed.
Miya has been a software professional since 1997. His 16 years software development career includes working for large companies to small startups, building solutions for enterprises and consumers, working with a broad range of technologies.
Miya Longwe is a hands-on java developer. He believes that in order to be a relevant and effective software developer one needs to remain a deeply knowledgeable, up-to-date, and productive software developer. His research interests include model-driven engineering, domain specific languages, test driven development and project risk management.
Miya graduated from the University of Malawi (Lilongwe, Malawi) and has an MBA from the University of Wales Cardiff Business School (Wales, UK) and a Masters in Software Engineering from Brandeis University (MA, USA).
Occasionally, Miya can be spotted fishing the banks of the south shore (MA) with his two boys, William and Daniel.
Scala, Spring-Boot, JPA를 활용한 웹 애플리케이션 개발 과정에 대해 다룬다. Spring-Boot와 JPA 조합만으로도 생산성 있는 웹 애플리케이션 개발이 가능하다. 이 조합만으로도 충분히 의미가 있지만 여기에 Scala라는 약간은 불편한 듯 보이는 언어를 도입함으로써 얻을 수 있는 즐거움을 공유한다. Spring-Boot + JPA 조합에 Scala를 적용하면서의 좌충우돌 경험담을 전한다.
JPA의 기본 개념에 대해 설명하고 MyBatis로 작성된 애플리케이션을 JPA로 리팩토링하는 과정을 단계별로 살펴봅니다.
목차
1. MyBatis
2. Why JPA?
3. MyBatis to JPA
- JPA 설정
- Entity
- 연관관계 설정
- Repository
- 애플리케이션에서의 사용
대상
- MyBatis를 실무에 사용하고 있으면서 JPA 도입을 고려하고 있는 백엔드 개발자
- JPA를 적용하면서 어려움을 겪었거나 JPA를 실제 적용하는 과정이 궁금한 개발자
NHN Forward 2018 컨퍼런스에서 발표한 자료입니다.
http://forward.nhnent.com/
MyBatis로 작성된 예제 프로그램을 JPA로 마이그레이션하는 방법에 대해 설명합니다.
cf.) https://github.com/nhnent/hands-on-labs.java.mybatis-to-jpa
탑크리에듀교육센터(www.topcredu.co.kr)제공
스프링프레임워크 & 마이바티스(Spring Framework, MyBatis)
16번째 자료입니다. 참고하시어 많은 도움되셨길 바랍니다.
교육 및 수강문의/기타문의사항은 홈페이지(www.topcredu.co.kr)를 통하여 하실 수 있습니다.^^
탑크리에듀교육센터(www.topcredu.co.kr)제공
15번째 스프링프레임워크 & 마이바티스(Spring Framework, MyBatis)자료입니다.
Spring JDBC에서 DB 접근하는 방법, Spring JDBC에서 DB 접근하는 방법 – jdbcTemplate, Maven, Gradle에서 오라클 설정에 대해 설명한 자료이니 많은 참고 바랍니다.
23. EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
// 비 영속 상태
User user = new User("wons", "12345", "woniper");
// 영속 상태
// 1차 캐시 저장, Query 생성 및 저장
em.persist(user);
// 준영속 상태
// SQL 저장소 Query DB에 반영
em.getTransaction().commit();
em.close();
28. EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
// 영속 엔티티
User user = em.find(User.class, 1);
// 준영속 상태
em.getTransaction().commit();
em.close();
33. EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
// 영속 상태
// 1차 캐시 저장
User user = em.find(User.class, 1);
// 자동 변경 감지
user.setUserName("updateName");
user.setPassword("1111");
user.setNickName("updateNick");
// 준영속 상태
em.getTransaction().commit();
em.close();
38. EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
// 영속 상태
// 1차 캐시 저장
User user = em.find(User.class, 1);
// 삭제 상태, Query 생성 및 저장
em.remove(user);
// SQL 저장소 Query DB에 반영
em.getTransaction().commit();
em.close();
표준 ORM
ORM == RDB와 객체를 매핑 및 사용 (가장 중요)
표준 interface 제공 -> 구현체
Hibernate를 기준으로 발표
자바 개발자
이해 X
3단계 코드
현업 X
JDBC에 비교 -> Connection, Close, 매핑 불필요
쿼리에 집중
S모전자 Map<> 이야기
자극적
JPA는 쿼리 작성 X
ORM은 테이블과 객체를 매핑이 가장 중요(오해 X)
EntityManager
메소드 간단 설명
update(자동 변경 감지)
Connection, Close, 쿼리 자동 생성
JPA는 CRUD를 편하게 하기 위함 X
엔티티 설명
객체와 테이블을 매핑하기 위한 클래스
생명주기
생김새 -> DTO, VO
애노테이션 설명
자세한 설명 X
4가지 엔티티 상태
new 키워드(비영속) -> 순수 객체
영속성 컨텍스트 간단 설명
저장된 상태 -> 영속 엔티티 (persist)
삭제 상태 -> remove
분리된 상태 -> 준영속 엔티티(detach)
이해 못하면 데이터 손실 위험
대망에 영속성 컨텍스트
집중!!!
모두 설명 X
EntityManagerFactory
persistence 설정 -> META-INF/persistence.xml -> 자세한 설명 X
EntityManager 생성 -> 영속성 컨텍스트 영역 생성
se, spring에서 생성 차이점(간단하게)
이 부분을 이해해야 뒤에 설명이 잘 이해됨
물리적 X, EntityManager로 접근
JDBC로 동기화
SQL 저장소(쓰기 지연 SQL이 가능), DB갔다 오는 횟수를 줄임
1차 캐시 영역
@ID == 식별자
Entity == 최신화 엔티티
Snapshot == 최초 엔티티
CRUD 코드와 그림
트랜잭션을 시작
객체 생성
저장
커밋
1차 캐시 영역을 토대로 쿼리 생성
flush는 Commit되기 전에 항상 호출(뒤에서 설명)
1차 캐시에 있으면 DB조회 X
저장 후 반환
update 메소드 X
자동 변경 감지
commit하기 전 flush
비교(최신화 엔티티, 최초 엔티티)
비교를 통해 update 쿼리 생성 및 저장
실제 물리적 공간인 DB에 저장
1차 캐시 먼저 삭제
쿼리 생성 및 저장
실제 물리적 DB에 저장
트랜잭션 단위안에서 동작
flush는 영속성 컨텍스트를 DB에 동기화
commit은 실제로 DB에 저장
할까 말까 고민
뺄수 없었음
전 내용 이해 물어보기
clear : 모두 제거 -> 변경 사항 적용 안됨
detach : 특정 엔티티 제거
close : EntityManager 종료
username == woniper라고 가정
코드 설명
다시 조회
문제 내기 -> username에 속성값은 무엇일까?
User1 == lee-kyung-won
Entity에 username == woniper
식별자로 조회 후 저장