This document provides an overview and tutorials for using MyBatis with Spring Boot. It introduces the mybatis-spring-boot-starter dependency, and covers setting up MyBatis mappers using annotation and XML styles. It also demonstrates MyBatis configuration in Spring Boot, database migrations with Flyway, and MyBatis testing. Additional sections explain concepts like repositories, Java configuration, and using QueryDSL with MyBatis.
This ppt provide basic understanding regarding Spring Boot. And how to configure Spring Boot application with Hibernate and mysql by using eclipse IDE. Also provides understanding about how to configure Spring Tool Suit (STS) in Eclipse.
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
This ppt provide basic understanding regarding Spring Boot. And how to configure Spring Boot application with Hibernate and mysql by using eclipse IDE. Also provides understanding about how to configure Spring Tool Suit (STS) in Eclipse.
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Top 50 Node.js Interview Questions and Answers | EdurekaEdureka!
YouTube Link: https://youtu.be/6WYEmUVhiwQ
** Node.js Certification Training: https://www.edureka.co/nodejs-certification-training **
This Edureka PPT on 'Node.js Interview Questions' will help you in preparing better for your Node.js Interviews and ace it. In this session, we will be discussing Top 50 frequently asked questions in Node.js.
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
University of Colorado PhD software engineering student Aaron Schram explains the details of creating a web applications using the Spring MVC framework
Presentation explain about
Spring Boot vs Spring vs Spring MVC,
Advantages,
Where to start and how does Spring boot work ?,
Dependency Management,
Logging,
Exception Handling,
Database Handling.
in Spring boot.
Building a REST Service in minutes with Spring BootOmri Spector
A walk through building a micro service using Spring Boot.
Deck presented at Java 2016
Source accompanying presentation can be found at https://github.com/ospector/sbdemo
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.
La Java Persistence API (abrégée en JPA), est une interface de programmation Java permettant aux développeurs d'organiser des données relationnelles dans des applications utilisant la plateforme Java.
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Testing with JUnit 5 and Spring - Spring I/O 2022Sam Brannen
This session will give you an overview of the latest and greatest in the world of testing using JUnit Jupiter (a.k.a. JUnit 5) and the Spring Framework.
The focus will be major new features in JUnit Jupiter 5.8 and 5.9 as well as recent and upcoming enhancements to Spring's integration testing support.
Introduction to the Spring Framework:
Generar description
IoC container
Dependency Injection
Beans scope and lifecycle
Autowiring
XML and annotation based configuration
Additional features
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slidesHitesh-Java
In this Java Spring Training session, you will learn Spring AOP – Aspect Oriented Programming. Topics covered in this session are:
For more information, visit this link:
• Spring framework
• Inversion of Control
• Dependency Injection – Two types
• Defining beans using XML
• Inheriting beans
• Auto-wiring
• Annotations based configuration
• Java based configuration
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
Top 50 Node.js Interview Questions and Answers | EdurekaEdureka!
YouTube Link: https://youtu.be/6WYEmUVhiwQ
** Node.js Certification Training: https://www.edureka.co/nodejs-certification-training **
This Edureka PPT on 'Node.js Interview Questions' will help you in preparing better for your Node.js Interviews and ace it. In this session, we will be discussing Top 50 frequently asked questions in Node.js.
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
University of Colorado PhD software engineering student Aaron Schram explains the details of creating a web applications using the Spring MVC framework
Presentation explain about
Spring Boot vs Spring vs Spring MVC,
Advantages,
Where to start and how does Spring boot work ?,
Dependency Management,
Logging,
Exception Handling,
Database Handling.
in Spring boot.
Building a REST Service in minutes with Spring BootOmri Spector
A walk through building a micro service using Spring Boot.
Deck presented at Java 2016
Source accompanying presentation can be found at https://github.com/ospector/sbdemo
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.
La Java Persistence API (abrégée en JPA), est une interface de programmation Java permettant aux développeurs d'organiser des données relationnelles dans des applications utilisant la plateforme Java.
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Testing with JUnit 5 and Spring - Spring I/O 2022Sam Brannen
This session will give you an overview of the latest and greatest in the world of testing using JUnit Jupiter (a.k.a. JUnit 5) and the Spring Framework.
The focus will be major new features in JUnit Jupiter 5.8 and 5.9 as well as recent and upcoming enhancements to Spring's integration testing support.
Introduction to the Spring Framework:
Generar description
IoC container
Dependency Injection
Beans scope and lifecycle
Autowiring
XML and annotation based configuration
Additional features
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slidesHitesh-Java
In this Java Spring Training session, you will learn Spring AOP – Aspect Oriented Programming. Topics covered in this session are:
For more information, visit this link:
• Spring framework
• Inversion of Control
• Dependency Injection – Two types
• Defining beans using XML
• Inheriting beans
• Auto-wiring
• Annotations based configuration
• Java based configuration
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
How to Choose an API Automation Tool for a Distributed Cloud-based App: To...Altoros
This presentation describes 10 key criteria for selecting API automation tools, such as WSO2 API Manager and Apache UserGrid. It also highlights:
- Examples of APIs in Use
- Why Automate?
- Evaluation Criteria: What Is Important and Why?
- 7 Steps for Comparing API Platforms
etc.
Pragmatic RESTful API principles, along with a solid consumption architecture, can allow for a great amount of automation in your program development. At the same time, securing the application can be extremely tricky from JavaScript.
In this session we will explore several principles behind RESTful API design and consumption using JavaScript, many of the standards that were integrated in the redevelopment of the PayPal API architecture in the new RESTful APIs.
We will cover many of these architecture standards, including:
- Building in action automation using HATEOAS
- OAuth 2 in the JavaScript model
- The challenges behind secure resource consumption through JavaScript
http://openerp.com
Technical Presentation of the main changes in OpenERP 6.1 at the API and framework level: architecture changes, API evolution, new UI features, etc.
See also the related presentation about the new 6.1 Web layer: http://www.slideshare.net/openobject/openerp-61-web-framework-tutorial
Design Summit - RESTful API Overview - John HardyManageIQ
This is an overview of the new RESTful API in the ManageIQ Anand release. Build cross-cloud applications and management systems using ManageIQ as a developer platform.
More more on ManageIQ, see http://manageiq.org/
Pragmatic RESTful API principles, along with a solid consumption architecture, can allow for a great amount of automation in your program development. At the same time, securing the application can be extremely tricky from JavaScript.
In this session we will explore several principles behind RESTful API design and consumption using JavaScript, many of the standards that were integrated in the redevelopment of the PayPal API architecture in the new RESTful APIs.
We will cover many of these architecture standards, including:
* Building in action automation using HATEOAS
* OAuth 2 in the JavaScript model
* The challenges behind secure resource consumption through JavaScript
Participants will be introduced to the principles of Lean and the application of Kanban to visualize their work, limit distraction and waste, and get stuff done.
I’ll cover the core concepts outlined in Jim Benson and Tonianne DeMaria Barry's book, Personal Kanban, to get you started.
Due to the popular of Smart Phone application recently, Single Page Application (SPA) model has been the trend for Web application development and is taking place of the traditional MVC model. Web API is the key factor of the shift from SPA model to MVC model. For that reason, test automation is expected to shift left to get feedback as soon as possible, and Web API testing has become more and more important. The talk will discuss:
- What is Web API? How SOAP is different from REST APIs
API test and its checkpoints
- How Frisby makes testing REST API endpoints easy, fast, and fun in the world of Node.js
Webpack Encore - Asset Management for the rest of usStefan Adolf
Dealing assets from within monolithic project that even come with a legacy is mostly hard. Encore paves the way for your migration to the "modern" world of frontend technology. It provides an opinonated and very condensed interface to the almighty webpack bundler that just does what you expect from it. Including entry points, tree shaking, code splitting and lazy loading. This talk and its supporting git repo show some of the Encore concepts and comes with a fully working dockerized Symfony 4.2 application utilizing a combined Vue.js and jQuery (sic) frontend. https://github.com/elmariachi111/encore-demo/tree/2019-encore-vue-components (use the 2019- branches)
Quick and Easy Development with Node.js and Couchbase ServerNic Raboy
Build an API driven Node.js application that uses Couchbase for its NoSQL database and AngularJS for its front-end. Presented by Nic Raboy, Developer Advocate at Couchbase.
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyMark Proctor
This is an overview video that shows the scope of work and technology used within the Red Hat JBoss BRMS and BPMS platforms.
The technology presented builds with GWT, Errai and UberFire as the foundation. Over 2015 we'll be working to make it for end users to consume the bits they need, paying for only what they use, so others can make power web platforms like BRMS and BPMS.
Take Control of your Integration Testing with TestContainersNaresha K
Slides from my Java2Days conference talk - Take Control of your Integration Testing with TestContainers.
How easy is it to write and maintain integration tests when your system under test interacts with databases, message stores, and other external systems? It can be quite challenging, can’t it? For example, the lack of control over the setup of databases can increase the cost of integration testing. Sometimes we take the route of using an in-memory database instead of the one we employ in the production environment, making the tests less effective. With Docker containers, you can simplify this to some extent by running the setup before invoking your tests. Imagine if you get to control the database environment right from within the test code. TestContainers bring in this convenience.
TestContainers is a tool that you can invoke from your test code. It provides lightweight, throwaway instances of common databases, web browsers(Selenium tests), or anything else that can run in a Docker container. In this presentation, I walk you through how TestContainers is the most effective way to take advantage of Docker containers for integration testing. I present through several use-cases and demonstrate how TestContainers simplifies integration testing.
Luca Mezzaira ha presentato il case study di DAZN spiegando cosa sono le micro-architetture e focalizzandosi sui micro-frontends.
Durante l'intervento, il relatore ci ha spiegato come DAZN si è approcciato allo sviluppo della propria piattaforma evolvendola da una single page application a micro-frontends.
E' seguito poi uno spazio per domande e curiosità riguardo la tematica affrontata nell’intervento.
An interactive Liferay (DXP) 7 Tech Meet up was codified by Azilen Technologies on 18th March, 2017 at Ahmedabad Management Association.
Those who have missed the direct confrontation can explore few of the knowledge elements here in the Presentation.
Back to Basics, webinar 2: La tua prima applicazione MongoDBMongoDB
Questo è il secondo webinar della serie Back to Basics che ti offrirà un'introduzione al database MongoDB. In questo webinar ti dimostreremo come creare un'applicazione base per il blogging in MongoDB.
Similar to SpringBoot with MyBatis, Flyway, QueryDSL (20)
Spring Data Requery is alternatives of Spring Data JPA
Requery is lightweight ORM for DBMS (MySQL, PostgreSQL, H2, SQLite, Oracle, SQL Server)
Spring Data Requery provide Query By Native Query, Query By Example and Query By Property like Spring Data JPA
Spring Data Requery is better performance than JPA
Alternatives of JPA
Requery provide simple Object Mapping & Generate SQL to execute without reflection and session, so fast than JPA, simple and easy to learn.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
In the ever-evolving landscape of technology, enterprise software development is undergoing a significant transformation. Traditional coding methods are being challenged by innovative no-code solutions, which promise to streamline and democratize the software development process.
This shift is particularly impactful for enterprises, which require robust, scalable, and efficient software to manage their operations. In this article, we will explore the various facets of enterprise software development with no-code solutions, examining their benefits, challenges, and the future potential they hold.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
AI Genie Review: World’s First Open AI WordPress Website CreatorGoogle
AI Genie Review: World’s First Open AI WordPress Website Creator
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-genie-review
AI Genie Review: Key Features
✅Creates Limitless Real-Time Unique Content, auto-publishing Posts, Pages & Images directly from Chat GPT & Open AI on WordPress in any Niche
✅First & Only Google Bard Approved Software That Publishes 100% Original, SEO Friendly Content using Open AI
✅Publish Automated Posts and Pages using AI Genie directly on Your website
✅50 DFY Websites Included Without Adding Any Images, Content Or Doing Anything Yourself
✅Integrated Chat GPT Bot gives Instant Answers on Your Website to Visitors
✅Just Enter the title, and your Content for Pages and Posts will be ready on your website
✅Automatically insert visually appealing images into posts based on keywords and titles.
✅Choose the temperature of the content and control its randomness.
✅Control the length of the content to be generated.
✅Never Worry About Paying Huge Money Monthly To Top Content Creation Platforms
✅100% Easy-to-Use, Newbie-Friendly Technology
✅30-Days Money-Back Guarantee
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIGenieApp #AIGenieBonus #AIGenieBonuses #AIGenieDemo #AIGenieDownload #AIGenieLegit #AIGenieLiveDemo #AIGenieOTO #AIGeniePreview #AIGenieReview #AIGenieReviewandBonus #AIGenieScamorLegit #AIGenieSoftware #AIGenieUpgrades #AIGenieUpsells #HowDoesAlGenie #HowtoBuyAIGenie #HowtoMakeMoneywithAIGenie #MakeMoneyOnline #MakeMoneywithAIGenie
3. MyBatis for Spring Boot
• MyBatis 를 Spring Boot Application 에서 사용하기 위한
라이브러리
• 홈페이지 : http://www.mybatis.org/mybatis-spring-boot/
• 소스 : https://github.com/mybatis/mybatis-spring-boot
• 예제 :
• KESTI SpringBoot-MyBatis Tutorials
• Spring Boot 에서 Java Config를 통해 myBatis 연동하기
2016-10-12KESTI 개발팀 세미나 3
8. XML Mapper
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.kesti.mybatis.examples.domain.models">
<select id="selectActorByFirstname" parameterType="String" resultType="Actor">
SELECT * FROM Actors WHERE firstname = #{firstname} limit 1
</select>
<insert id="insertActor" useGeneratedKeys="true" keyProperty="id">
insert into Actors(firstname, lastname)
values( #{firstname}, #{lastname} )
</insert>
<!-- Oracle, PostgreSQL 은 SEQUENCE -->
<!--
<insert id="insertActorBySequence">
<selectKey keyProperty="id" resultType="int" order="BEFORE" statementType="PREPARED">
SELECT SEQ_ID.nextval FROM DUAL
</selectKey>
INSERT INTO Autors (id, firstname, lastname)
VALUES (#{id}, #{firstname}, #{lastname})
</insert>
-->
</mapper>
2016-10-12KESTI 개발팀 세미나 8
9. Annotated Mapper
/**
* Actor 를 위한 MyBatis Mapper 입니다.
*/
public interface ActorMapper {
@Select("SELECT * FROM Actors WHERE firstname = #{firstname}")
Actor findByFirstname(@Param("firstname") String firstname);
@Select("SELECT * FROM Actors")
List<Actor> findAll();
@Delete("DELETE FROM Actors WHERE id=#{id}")
void deleteById(@Param("id") Integer id);
}
/**
* MyBatis 를 Spring boot 에서 사용하기 위한 환경설정
*/
@Configuration
@EnableAutoConfiguration
@ComponentScan(basePackageClasses = { ActorRepository.class })
@MapperScan(basePackageClasses = { ActorMapper.class })
public class MyBatisConfiguration extends AbstractFlywayMyBatisConfiguration {
2016-10-12KESTI 개발팀 세미나 9
XML Mapper
보다 좋은점은?
10. Repository / DAO
/**
* {@link Actor} 를 위한 Repository (DAO) 입니다.
*/
@Slf4j
@Repository
public class ActorRepository {
@Autowired ActorMapper mapper;
@Autowired SqlSessionTemplate session;
public Actor findByFirstname(@NonNull String firstname) {
return mapper.findByFirstname(firstname);
}
public Actor findByFirstnameWithXmlMapper(@NonNull String firstname) {
return session.selectOne("selectActorByFirstname", firstname);
}
public List<Actor> findAll() {
return mapper.findAll();
}
public int insertActor(@NonNull Actor actor) {
return session.insert("insertActor", actor);
}
public void deleteById(@NonNull Integer id) {
mapper.deleteById(id);
}
}
2016-10-12KESTI 개발팀 세미나 10
11. MyBatis JavaConfig
@Configuration
@EnableAutoConfiguration
@ComponentScan(basePackageClasses = { ActorRepository.class })
@MapperScan(basePackageClasses = { ActorMapper.class })
public class MyBatisConfiguration extends AbstractFlywayMyBatisConfiguration {
// datasource 용 properties (application.properties 에서 자동으로 정보를 읽어옴)
@Inject DataSourceProperties dataSourceProperties;
// mybatis 용 properties (application.properties 에서 자동으로 정보를 읽어옴)
@Inject MybatisProperties mybatisProperties;
@Override
protected DatabaseSetting getDatabaseSetting() {
return DatabaseSetting.builder()
.driverClass(dataSourceProperties.getDriverClassName())
.jdbcUrl(dataSourceProperties.getUrl())
.build();
}
@Override
protected String getMyBatisConfigPath() {
return mybatisProperties.getConfig();
}
@Override
protected String getMyBatisMapperPath() {
return mybatisProperties.getMapperLocations()[0];
}
}
2016-10-12KESTI 개발팀 세미나 11
XML Config
와 장단점
비교
21. QueryDSL 개요
• 질의어를 문자열이 아닌 Java Code로 표현
• Query문 – type check 불가 / 실행 전에는 오류 검출 불가
• Java Code는
• Compile Error를 미리 검출
• Code assistant 활용 100%
• Refactoring 용이
• 다양한 저장소에 대한 일관된 질의어 제작 가능
• Collection, RDBMS, MongoDB, Lucene …
• .NET 의 LINQ 같은 목적 (Langunage-INtegrated Query)
• 참고 : 한글 매뉴얼 (단 3.4.0 기준임. 4.x 는 package 명이
달라졌음)
2016-10-12KESTI 개발팀 세미나 21
22. QueryDSL 적용 범위
JPA (Java Persistence API)
JDO (Java Data Object)
SQL
Lucence
MongoDB
Collections
QueryDSL
RDBMS
ORM
Lucene
(search
engine)
MongoD
B
List / Map
2016-10-12KESTI 개발팀 세미나 22
23. QueryDSL for SQL
• Select
• Join (innerJoin, join, leftJoin, rightJoin, fullJoin)
• group by / having
• order by
• limit / offset / restrict
• subquery
• Window functions
• Common Table Expression (CTE)
• Insert
• Update
• Delete
2016-10-12KESTI 개발팀 세미나 23
31. QueryDSL Generated Code
2016-10-12KESTI 개발팀 세미나 31
/**
* QActors is a Querydsl query type for QActors
*/
@Generated("com.querydsl.sql.codegen.MetaDataSerializer")
public class QActors extends RelationalPathSpatial<QActors> {
private static final long serialVersionUID = 822224394;
public static final QActors actors = new QActors("actors");
public final StringPath firstname = createString("firstname");
public final NumberPath<Integer> id = createNumber("id", Integer.class);
public final StringPath lastname = createString("lastname");
public final com.querydsl.sql.PrimaryKey<QActors> actorsPkey = createPrimaryKey(id);
public QActors(String variable) {
super(QActors.class, forVariable(variable), "public", "actors");
addMetadata();
}
public QActors(String variable, String schema, String table) {
super(QActors.class, forVariable(variable), schema, table);
addMetadata();
}
public QActors(Path<? extends QActors> path) {
super(path.getType(), path.getMetadata(), "public", "actors");
addMetadata();
}
public QActors(PathMetadata metadata) {
super(QActors.class, metadata, "public", "actors");
addMetadata();
}
public void addMetadata() {
addMetadata(firstname, ColumnMetadata.named("firstname").withIndex(2).ofType(Types.VARCHAR).withSize(64));
addMetadata(id, ColumnMetadata.named("id").withIndex(1).ofType(Types.INTEGER).withSize(10).notNull());
addMetadata(lastname, ColumnMetadata.named("lastname").withIndex(3).ofType(Types.VARCHAR).withSize(64));
}
}