初识Spring Data全家族(3)

Spring Data JPA用法详解 Spring Data JPA: JPA(Java Persistence API)即java持久化API,它的出现主要是为了简化持久层开发以及整合ORM技术,结束Hibernate、TopLink、JDO等ORM框架各自为营的局面。JPA是在吸收现有ORM框架的基础上发展而来,易于使用,伸缩性强。总的来说,JPA包括以下三方面的技术: ORM映射元数据:支持XML和注解两种元数据的形式,元数据描述对象和表之间的映射关系 API:操作实体对象来执行CRUD操作 查询语言:通过面向对象而非面向数据库的 阅读详情

每天叫醒你的不是闹钟,而是梦想

4

Spring Data JPA的事务支持

      Spring Data JPA对所有的默认方法都开启了事务支持,且查询事务默认启用readOnly = true属性(指定当前事务是只读事务)

我们通过查看SimpleJpaRepository的部分源码,来查看Spring Data JPA的事务支持

@Repository
@Transactional(
 readOnly = true
)
public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T, ID> {
@Transactional
public void delete(T entity) {
 Assert.notNull(entity, "The entity must not be null!");
 this.em.remove(this.em.contains(entity) ? entity : this.em.merge(entity));
}

@Transactional
public void deleteAll(Iterable<? extends T> entities){
 Assert.notNull(entities, "The given Iterable of entities not be null!");
 Iterator var2 = entities.iterator();

 while(var2.hasNext()) {
 T entity = var2.next();
 this.delete(entity);
 }

}

@Transactional
public void deleteInBatch(Iterable<T> entities) {
 Assert.notNull(entities, "The given Iterable of entities not be null!");
 if (entities.iterator().hasNext()) {
 QueryUtils.applyAndBind(QueryUtils.getQueryString("delete from %s x", this.entityInformation.getEntityName()), entities, this.em).executeUpdate();
 }
}

@Transactional
public void deleteAll() {
 Iterator var1 = this.findAll().iterator();

 while(var1.hasNext()) {
 T element = var1.next();
 this.delete(element);
 }

}
public T getOne(ID id) {
 Assert.notNull(id, "The given id must not be null!");
 return this.em.getReference(this.getDomainClass(), id);
}


public List<T> findAll() {
 return this.getQuery((Specification)null, (Sort)Sort.unsorted()).getResultList();
}



public List<T> findAll(Sort sort) {
 return this.getQuery((Specification)null, (Sort)sort).getResultList();
}

public Page<T> findAll(Pageable pageable) {
 return (Page)(isUnpaged(pageable) ? new PageImpl(this.findAll()) : this.findAll((Specification)null, pageable));
}


@Transactional
public <S extends T> S save(S entity) {
 if (this.entityInformation.isNew(entity)) {
 this.em.persist(entity);
 return entity;
 } else {
 return this.em.merge(entity);
 }
}

@Transactional
public <S extends T> S saveAndFlush(S entity) {
 S result = this.save(entity);
 this.flush();
 return result;
}

@Transactional
public <S extends T> List<S> saveAll(Iterable<S> entities) {
 Assert.notNull(entities, "The given Iterable of entities not be null!");
 List<S> result = new ArrayList();
 Iterator var3 = entities.iterator();

 while(var3.hasNext()) {
 S entity = var3.next();
 result.add(this.save(entity));
 }

 return result;
}

@Transactional
public void flush() {
 this.em.flush();
}
}

从源码中我们可以看出, SimpleJpaRepository在类级别定义了@Transactional(readOnly = true), 而在和save、delete相关的操作重写了@Transactional属性,此时readOnly属性是false,其余查询操作readOnly仍然为true

注意:@Transactional不仅可以注解在方法上, 也可以注解在类。当注解在类上的时候意味着此类的所有public方法都是开启事务的。如果类级别和方法级别同时使用了@Transactional注解,则使用方法级别覆盖类级别注解

readOnly的默认值为false

5

Spring Data JPA事务回滚实例

package com.zero.ch8_2.service.impl;

import com.zero.ch8_2.dao.PersonRepository;
import com.zero.ch8_2.domain.Person;
import com.zero.ch8_2.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: Zero
 * @Date: 2019/4/15 22:33
*/
public class PersonServiceImpl implements PersonService {

 @Autowired
 PersonRepository personRepository;


 @Override
 @Transactional(rollbackFor = {IllegalArgumentException.class}) //rollbackFor属性,指定特定异常时,数据回滚
 public Person savePersonWithRollBack(Person person) {
 Person p = personRepository.save(person);

 if(person.getName() .equals("zero")){
 throw new IllegalArgumentException("zero already exist,data will rollback");
 }
 return p;
 }

 @Override
 @Transactional(noRollbackFor = {IllegalArgumentException.class}) ////noRollbackFor属性,指定特定异常时,数据不回滚
 public Person savePersonWithoutRollBack(Person person) {

 Person p = personRepository.save(person);

 if(person.getName() .equals("zero")){
 throw new IllegalArgumentException("zero already exist,data will not rollback");
 }
 return p;
 }
}

6

数据缓存 Cache

6.1 什么是缓存

       我们知道一个程序的瓶颈在于数据库, 我们也知道内存的速度是大大快于硬盘的速度的。 当我们需要重复地获取相同的数据的时候,我们一次又一次的请求数据库, 导致大量的时间耗费在数据库查询方法的调用上,导致程序性能的恶化,这便是数据缓存要解决的问题。

6.2声名式缓存注解

  • @Cacheble  : 在方法执行前Spring先查看缓存中是否有数据, 如果有数据,则直接返回缓存数据;若没有数据,调用方法并将方法返回值放进缓存

  • @CachePut : 无论怎样,都会将方法的返回值放到缓存中。 @CachePut的属性与@Cacheable保持一致。

  • @CacheEvict : 将一条或多条数据从缓存中删除。

  • @Caching : 可以通过@Caching注解组合多个注解策略在一个方法上。

首先在启动类中添加缓存注解

package com.zero.ch8_2;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

@SpringBootApplication
@EnableCaching
public class Ch82Application {

 public static void main(String[] args) {
 SpringApplication.run(Ch82Application.class, args);
 }

}
package com.zero.ch8_2.service.impl;

import com.zero.ch8_2.dao.PersonRepository;
import com.zero.ch8_2.domain.Person;
import com.zero.ch8_2.service.CacheService;
import org.hibernate.annotations.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;



/**
 * @Author: Zero
 * @Date: 2019/4/15 23:58
*/
public class CacheServiceImpl implements CacheService {

 @Autowired
 PersonRepository personRepository;


 @Override
 @CachePut(value = "people", key = "#person.id")
 // 缓存新增的或更新的数据到缓存, 其中缓存名称为people, 数据的key是person的id
 public Person save(Person person) {
 Person p = personRepository.save(person);

 return p;
 }

 @Override
 @CacheEvict(value = "people")
 // @CacheEvict从缓存people中删除key为id的数据
 public void remove(Long id) {

 personRepository.delete(id);
 }

 @Override
 @Cacheable(value = "people", key = "#people.id")
 // @Cacheable缓存key为person的id数据到缓存people中
 public Person findOne(Person person) {
 Person p = personRepository.findOne(person.getId());
 return p;
 }
}

历史文章

初始Spring Data全家族(2)

初识Spring Data 全家族(1)

点击蓝字关注我们

SpringCloud集成Spring Data JPA 文章目录Spring Data源码springcloud-parent2父Maven模块spring-data子Maven模块分析 Spring Data   Spring Data是Spring家族中最重要的核心成员之一,在Spring Data中,其专门为Spring提供了用于数据访问的抽象框架,其核心理念是支持对所有的存储进行资源配置从而实现数据访问。   数据的访问,需要完成领域对象与存储... 阅读详情

相关推荐

Spring Data LDAP 2.2.5 是 Spring Data 家族的一个模块,属于 **Spring Data Moore** 版本系列

Spring Data LDAP 2.2.5 是 Spring Data 家族的一个模块,属于 **Spring Data Moore** 版本系列(对应 Spring Boot 2.2.x),旨在为 LDAP(轻量目录访问协议)提供类似于 Spring Data JPA 的抽象和便利的 Repository 支持。它简化了与 LDAP 目录服务器(如 OpenLDAP、Microsoft Active Directory)之间的数据交互。

[Blog][Domain] programb.blog.youkuaiyun.com 499

瑞吉外卖学习笔记6

在SetmealController类中添加save方法。编写controller:上面的dishList,我们数据库并不需要这个数据,所以接收数据的实体类没有dishList这个属性也没有关系,前端传过来的数据都是自动映射到接收数据的实体类的属性上的,没有对应起来就不会映射。在套餐管理界面,套餐分类字段显示的是categoryId对应的中文,但在数据库里查询到的是categoryId,因此需要利用categoryId查询到categoryName,并赋值给数据传输对象SetmealDto。

peihj的博客 1016

Spring Data Redis 实践

关于Spring Data Redis的简单应用以及1.7新特性Redis Repositories简介~

小灯光环 9131

初识Spring Data 全家族(1)

每天叫醒你的不是闹钟,而是姿势1前言 在介绍Spring Dara Jpa之前,我们首先认识HIbernate。Hibernate是数据访问解决技术的绝对霸主,使用ORM...

ZeJava的博客 338

从零到一:树莓派上的YOLO目标检测实战指南

本文详细介绍了如何在树莓派上部署和优化YOLO目标检测模型,从硬件选型到系统配置,再到模型转换与推理优化。通过对比不同树莓派型号的性能差异,提供实用的配置方案和代码示例,帮助开发者快速实现高效的边缘计算视觉系统。特别推荐使用ONNX格式进行模型转换,以提升在树莓派上的推理效率。

weixin_29046035的博客 1063

【编号326】全国地灾数据全国25万多个地质灾害点空间分布数据

全国地质灾害点分布数据涵盖25万多个各类灾害点信息,为灾害防治提供重要依据。通过分析灾害分布规律,可识别高风险区,指导监测预警、应急避险和基础设施建设。多地成功案例(如湖北兴山崩塌避险、重庆长寿滑坡预警、湖南"挪床行动")证明,提前预警和科学防治能有效避免人员伤亡。云南省2024年通过预警体系成功避让31起灾害,保护1342人生命安全。这些实践表明,地质灾害防治需结合科技手段与群防体系,实现早预警、早处置。

千奇百怪无奇不有 1467

JPA的saveAndFlush

JPA的saveAndFlush

wsdhla的专栏 1827

FFmpeg硬件加速实战:VAAPI驱动配置全攻略(含NVIDIA/Intel避坑指南)

本文详细解析了在Linux环境下配置FFmpeg使用VAAPI接口实现硬件加速的完整流程。针对NVIDIA、Intel等主流显卡,提供了从驱动安装、环境变量设置到多显卡切换的实战指南,并重点解决了闭源驱动冲突、国产系统适配等常见问题,帮助用户有效提升视频处理性能。

weixin_29306011的博客 453

Spring Data 家族之Redis

spring boot redis template 使用

weng74的博客 1161

超详细流式细胞术全流程解析:从样本制备到结果分析全攻略

流式细胞术(Flow Cytometry)是现代生物学和医学研究中不可或缺的高通量分析技术,可实现对细胞表型、功能状态、细胞周期等多维度参数的快速检测。本文将从实验全流程出发,详解样本制备、上机操作、参数设置及结果处理的核心要点,帮助科研人员精准掌握流式实验关键技术。

good_rrrrr的博客 3867

IDEA 2023.2.3全平台安装指南:Mac/Windows/Linux一键激活(附最新补丁获取)

本文提供IDEA 2023.2.3在Mac、Windows和Linux三大平台的一键安装与激活指南,包含最新补丁获取方法。详细讲解各系统安装流程、性能调优设置及高效开发技巧,帮助开发者快速配置并提升工作效率。

weixin_28832121的博客 395

Spring data 家族的模块

Spring Data 家族的模块 通过上图,我们可以看到JDBC,Redis,MongoDB,JPA。 Spring-Data-JDBC Spring-Data-JPA Spring-Data-MongoDB Spring-Data-Redis 引用自https://blog.csdn.net/hadues/article/details/85012999?ops_request_misc=&request_id=&biz_id=102&utm_term=spring%20

matthewchen123的博客 245

海思Hi3516CV610开发实战:在Ubuntu 22.04上从零构建嵌入式Linux开发环境

本文详细介绍了在Ubuntu 22.04上为海思Hi3516CV610开发板搭建嵌入式Linux开发环境的完整流程。从虚拟机配置、系统安装到基础环境设置,提供了实用技巧和常见问题解决方案,帮助开发者高效构建适用于智能视觉处理的开发环境。

weixin_29197699的博客 508

Spring Boot 整合 Spring Data JPA、strategy 的策略区别、什么是 Spring Data JPA

Spring Boot 整合 Spring Data JPA、strategy 的策略区别、什么是 Spring Data JPA

hutao8896的博客 1113

在Android Jetpack Compose中实现夜间模式

Android基于Compose的深色主题实现

虎哥LoveDroid 1234

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

Spring家族产品

**简介**:Spring Boot是一个基于Spring Framework的快速开发框架,它通过“约定优于配置”的原则简化了基于Spring的应用程序开发。- **简介**:Spring Data是Spring提供的持久层框架,它为应用程序中的数据访问提供了一套统一的开发模型,同时保留了不同类型数据存储的特殊性。- **主要模块**:Spring Data JPA、Spring Data JDBC、Spring Data MongoDB、Spring Data Redis等。

weixin_39770667的博客 565

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Spring Data

Spring Data 是 Spring 团队推出的数据访问框架集合,旨在通过统一的方式简化各种数据源(关系型、文档型、KV、图数据库等)的操作。它提供了声明式、可扩展的 Repository 接口抽象,屏蔽底层繁琐的持久化细节。@Entity@Id​@Id标识主键,自动生成策略必须有无参构造函数支持 JPQL / 原生 SQL(nativeQuery = true)推荐使用 @Query 明确逻辑,避免方法名过长。

2301_79902294的博客 1298

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Spring Data Commons主要梳理

这篇文章是在看Spring Data Commons文档的时候梳理的内容,都是与Spring Data相关的,里面可能会涉及到Spring Data JPA的内容,但更多的是Commons的内容,Spring Data JPA只是一个具体的实现而已。 1. Spring Data 模块关系 Spring Data家族有多个模块: Spring Data JPA Spring Data Mongo...

机智猫 1万+

家族族谱管理系统基于Spring Boot

pring Boot框架的高效开发特性与强大功能集成能力,结合现代Web技术,旨在打造一个集家族成员信息管理、家族关系梳理、家族事件记录、家族文化传承等多功能于一体的数字化平台。

计算机程序开发设计 1180

Spring Data JDBC详解

Spring Data JDBC项目将Spring的核心概念应用于使用符合域驱动设计原则的JDBC数据库的解决方案的开发。它提供了一个“模板”作为存储和查询聚合的高级抽象。Spring Data JDBC的目标是简化数据库访问,特别是对于那些使用JDBC作为数据库访问技术的应用程序。

专业深耕,技术前沿 1081

基本概念之Spring家族详解

文章目录基本概念之Spring家族详解1. Spring简介2. Spring Framework3. Spring Boot4. Spring Data5. Spring Cloud6. Spring Security 基本概念之Spring家族详解 参考地址: 是时候给大家介绍 Spring Boot/Cloud 背后豪华的研发团队了。 1. Spring简介 首先需要澄清的是Spring不是一个公司。 Spring官方文档的简介是:Spring使Java编程更快、更简单、更安全。Spring对速

bigdata-page 1317

Spring初识(详解)

Spring这个框架最大的功能 就是能够为业务逻辑层 提供事务 整合第三方框架 他相当于是所有框架之间的粘合剂 也就是说 这个鬼就像我们的胶水 一样能够把其他的框架 整合到一起。:整个Spring家族中最重要的一个框架 其他框架都是存在于这个框架之上来进行开发的,其他的框架都会对Spring这个框架形成依赖。prototype:这个表示的是生成这个对象是多例的(是不会放到容器中的)既然他们都是将类的对象放到IOC容器中去 那么类的对象的名字是啥呢?类对象在IOC容器中销毁的时候 要进行资源回收的操作。

刘欣的博客 296

【SpringBoot从初学者到专家的成长01】Spring家族技术产品与生态圈介绍

Spring框架自2002年发布以来,逐步发展成为一个庞大的技术生态系统,为开发人员提供了广泛的解决方案,涵盖了从企业级应用到微服务架构、从数据访问到安全管理等多个领域。Spring的核心思想是**简化开发**,通过不同的子项目形成了一个强大的技术生态圈。本文将对Spring的核心技术产品以及Spring生态圈进行详细介绍。

低音钢琴的专栏 1094

最详细的Spring-data-jpa入门(一)

刚进公司,人生地不熟,偷偷藏着本《mybatis入土为安》,以为可以靠mybatis混的轻松点,谁知天有不测风云,大家用的是JPA。我这个小白没有听说过,全英文名叫,就是java持久化api,是SUN公司推出的一套基于的规范。持久化想必如雷贯耳,都0202年了,谁还不用个持久化框架啊,举起mybatis。ORM呢?全英文名为:对象关系映射,简单来说为了不用JDBC那一套原始方法来操作数据库,ORM框架横空出世(mybatis、hibernate等等)。...

此成非彼诚博客 10万+

Spring-Data-Jpa简介

官网: https://spring.io/projects/spring-data-jpa 官方介绍: Spring Data JPA, part of the larger Spring Data family, makes it easy to easily implement JPA based repositories. This module deals with enhanced support for JPA based data access layers. It makes it

m0_50052896的博客 1726
上一篇: 你的Java功底很深?Integer源码解读让你怀疑人生
下一篇: IDEA绝对好用的十大插件,不接受反驳
新时代Java农民工
博客等级 码龄7年 16粉丝 116原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值