iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >MyBatis如何实现自定义持久层框架
  • 512
分享到

MyBatis如何实现自定义持久层框架

2023-06-30 16:06:29 512人浏览 薄情痞子
摘要

这篇“mybatis如何实现自定义持久层框架”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“MyBatis如何实现自定义持久层

这篇“mybatis如何实现自定义持久层框架”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“MyBatis如何实现自定义持久层框架”文章吧。

自定义框架设计

使用端

提供核⼼配置⽂件:

sqlMapConfig.xml : 存放数据源信息,引⼊mapper.xml

Mapper.xml : sql语句的配置⽂件信息

框架端:

读取配置⽂件

读取完成以后以流的形式存在,我们不能将读取到的配置信息以流的形式存放在内存中,不好操作,可以创建JavaBean来存储

(1)Configuration : 存放数据库基本信息、Map<唯⼀标识,Mapper>, 唯⼀标识:namespace + "." + id

(2)MappedStatement:sql语句的id、sql语句、输⼊参数java类型、输出参数java类型

解析配置⽂件

创建SqlSessionFactoryBuilder类:

⽅法:返回值SqlSessionFactory,方法为build()

第⼀:使⽤dom4j解析配置⽂件,将解析出来的内容封装到ConfigurationMappedStatement

第⼆:创建SqlSessionFactory的实现类DefaultSqlSessionFactory

创建SqlSessionFactory

⽅法:openSession() : 获取SqlSession接⼝的实现类实例对象

创建SqlSession接⼝及实现类:主要封装crud⽅法

⽅法:selectList(String mappedStatementId,Object... param):查询所有

selectOne(String mappedStatementId,Object... param):查询单个

具体实现:封装JDBC完成对数据库表的查询操作

涉及到的设计模式

Builder构建者模式、⼯⼚模式、代理模式

自定义框架实现

这里只做比较繁琐的查询单条和查询多条的实现,添加、修改、删除的参考自行实现。

使用端

创建sqlMapConfig.xml

<configuration>        <!--数据库配置信息-->    <dataSource>        <property name="driverClass" value="com.mysql.jdbc.Driver"></property>        <property name="jdbcUrl" value="jdbc:Mysql:///learning_db"></property>        <property name="username" value="root"></property>        <property name="passWord" value="123456"></property>    </dataSource>    <!--存放mapper.xml的全路径-->    <mapper resource="UserMapper.xml"></mapper></configuration>

mapper.xml

<mapper namespace="com.snf.mapper.UserMapper">    <!--sql的唯一标识:namespace.id来组成 : mappedStatementId-->    <select id="findAll" resultType="com.snf.domain.User" >        select * from user    </select>    <!--        User user = new User()        user.setId(1);        user.setUsername("zhangsan")    -->    <select id="findByCondition" resultType="com.snf.domain.User" parameterType="com.snf.domain.User">        select * from user where id = #{id} and username = #{username}    </select></mapper>

User实体类

public class User {    private Integer id;    private String username;    public User() {    }    public User(Integer id, String username) {        this.id = id;        this.username = username;    }    public Integer getId() {        return id;    }    public void setId(Integer id) {        this.id = id;    }    public String getUsername() {        return username;    }    public void setUsername(String username) {        this.username = username;    }    @Override    public String toString() {        return "User{" +                "id=" + id +                ", username='" + username + '\'' +                '}';    }}

框架端

创建⼀个Maven⼦⼯程并且导⼊需要⽤到的依赖坐标

<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target></properties><dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.17</version> </dependency>  <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> </dependency>  <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.12</version> </dependency>  <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> </dependency>  <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency>  <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1.6</version> </dependency></dependencies>

Configuration配置类

public class Configuration {    private DataSource dataSource;        private Map<String,MappedStatement> mappedStatementMap = new HashMap<>();    public DataSource getDataSource() {        return dataSource;    }    public void setDataSource(DataSource dataSource) {        this.dataSource = dataSource;    }    public Map<String, MappedStatement> getMappedStatementMap() {        return mappedStatementMap;    }    public void setMappedStatementMap(Map<String, MappedStatement> mappedStatementMap) {        this.mappedStatementMap = mappedStatementMap;    }}

MappedStatement类

public class MappedStatement {    //sql语句id    private String id;    //sql语句    private String sql;    //输入参数类型    private String parameterType;    //返回参数类型    private String resultType;    public String getId() {        return id;    }    public void setId(String id) {        this.id = id;    }    public String getSql() {        return sql;    }    public void setSql(String sql) {        this.sql = sql;    }    public String getParameterType() {        return parameterType;    }    public void setParameterType(String parameterType) {        this.parameterType = parameterType;    }    public String getResultType() {        return resultType;    }    public void setResultType(String resultType) {        this.resultType = resultType;    }}

Resources类

public class Resources {    //以流的形式读取配置文件    public static InputStream getResourceAsStream(String path){        InputStream resourceAsStream = Resources.class.getClassLoader().getResourceAsStream(path);        return resourceAsStream;    }}

SqlSessionFactoryBuilder类

public class SqlSessionFactoryBuilder {    public SqlSessionFactory build(InputStream inputStream) throws PropertyVetoException, DocumentException {        //使用dom4j解析配置文件,将解析出来的内容封装到Configuration中        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder();        Configuration configuration = xmlConfigBuilder.parseConfig(inputStream);        //创建sqlSessionFactory工厂对象:生产sqlSession        DefaultSqlSessionFactory defaultSqlSessionFactory = new DefaultSqlSessionFactory(configuration);        return defaultSqlSessionFactory;    }}

XMLConfigBuilder类

public class XMLConfigBuilder {    private Configuration configuration;    public XMLConfigBuilder() {        this.configuration = new Configuration();    }        public Configuration parseConfig(InputStream inputStream) throws DocumentException, PropertyVetoException {        Document document = new SAXReader().read(inputStream);        Element rootElement = document.getRootElement();        List<Element> list = rootElement.selectnodes("//property");        Properties properties = new Properties();        list.forEach(element -> {            String name = element.attributeValue("name");            String value = element.attributeValue("value");            properties.setProperty(name, value);        });        ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource();        comboPooledDataSource.setDriverClass(properties.getProperty("driverClass"));        comboPooledDataSource.setJdbcUrl(properties.getProperty("jdbcUrl"));        comboPooledDataSource.setUser(properties.getProperty("username"));        comboPooledDataSource.setPassword(properties.getProperty("password"));        configuration.setDataSource(comboPooledDataSource);        //解析<Mapper>标签        List<Element> mapperList = rootElement.selectNodes("//mapper");        mapperList.stream()                .map(x -> x.attributeValue("resource"))                .map(Resources::getResourceAsStream)                .forEach(resourceAsStream -> {                    XmlMapperBuilder xmlMapperBuilder = new XmlMapperBuilder(configuration);                    try {                        xmlMapperBuilder.parse(resourceAsStream);                    } catch (DocumentException e) {                        e.printStackTrace();                    }                });        return configuration;    }}

XMLMapperBuilder类

public class XmlMapperBuilder {    private Configuration configuration;    public XmlMapperBuilder(Configuration configuration) {        this.configuration = configuration;    }    public void parse(InputStream inputStream) throws DocumentException {        Document document = new SAXReader().read(inputStream);        Element rootElement = document.getRootElement();        String namespace = rootElement.attributeValue("namespace");        List<Element> list = rootElement.selectNodes("//select");        list.forEach(element -> {            String id = element.attributeValue("id");            String parameterType = element.attributeValue("parameterType");            String resultType = element.attributeValue("resultType");            String sqlText = element.getTextTrim();            MappedStatement mappedStatement = new MappedStatement();            mappedStatement.setId(id);            mappedStatement.setParameterType(parameterType);            mappedStatement.setResultType(resultType);            mappedStatement.setSql(sqlText);            String key = namespace.concat(".").concat(id);            configuration.getMappedStatementMap().put(key, mappedStatement);        });    }}

SqlSessionFactory接口及DefaultSqlSessionFactory实现类

public interface SqlSessionFactory {    SqlSession openSession();}
public class DefaultSqlSessionFactory implements SqlSessionFactory {    private Configuration configuration;    public DefaultSqlSessionFactory(Configuration configuration) {        this.configuration = configuration;    }    @Override    public SqlSession openSession() {        return new DefaultSqlSession(configuration);    }}

SqlSession接口及DefaultSqlSession实现类

public interface SqlSession {    //查询所有    <E> List<E> selectList(String mappedStatementId,Object... params) throws IllegalAccessException, IntrospectionException, InstantiationException, NoSuchFieldException, SQLException, InvocationTargetException, ClassNotFoundException;    //根据条件    <T> T selectOne(String mappedStatementId,Object... params) throws IllegalAccessException, ClassNotFoundException, IntrospectionException, InstantiationException, SQLException, InvocationTargetException, NoSuchFieldException;    //为Dao接口生成代理实现类    <T> T getMapper(Class<T> mapperClass);}
public class DefaultSqlSession implements SqlSession {    private Configuration configuration;    public DefaultSqlSession(Configuration configuration) {        this.configuration = configuration;    }    @Override    public <E> List<E> selectList(String mappedStatementId, Object... params) throws IllegalAccessException, IntrospectionException, InstantiationException, NoSuchFieldException, SQLException, InvocationTargetException, ClassNotFoundException {        SimpleExecutor simpleExecutor = new SimpleExecutor();        MappedStatement mappedStatement = configuration.getMappedStatementMap().get(mappedStatementId);        List<Object> objectList = simpleExecutor.query(configuration, mappedStatement, params);        return (List<E>) objectList;    }    @Override    public <T> T selectOne(String mappedStatementId, Object... params) throws IllegalAccessException, ClassNotFoundException, IntrospectionException, InstantiationException, SQLException, InvocationTargetException, NoSuchFieldException {        List<Object> objectList = selectList(mappedStatementId, params);        if (objectList.size() == 1) {            return (T) objectList.get(0);        } else {            throw new RuntimeException("查询结果为空或者返回结果过多!");        }    }    @Override    public <T> T getMapper(Class<T> mapperClass) {        //使用jdk动态代理来为Dao接口生成代理对象,并返回        return (T) Proxy.newProxyInstance(DefaultSqlSession.class.getClassLoader(), new Class[]{mapperClass}, ((proxy, method, args) -> {            String methodName = method.getName();            String className = method.getDeclarinGClass().getName();            String mappedStatementId = className.concat(".").concat(methodName);            //获取被调用方法的返回值类型            Type genericReturnType = method.getGenericReturnType();            //判断是否进行了泛型类型参数化            if (genericReturnType instanceof ParameterizedType){                List<Object> objectList = selectList(mappedStatementId, args);                return objectList;            }            return selectOne(mappedStatementId,args);        }));    }}

Executor接口及SimpleExecutor实现类

public interface Executor {    <E>List<E> query(Configuration configuration, MappedStatement mappedStatement,Object... params) throws SQLException, IntrospectionException, InvocationTargetException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchFieldException;}
public class SimpleExecutor implements Executor {    @Override    public <E> List<E> query(Configuration configuration, MappedStatement mappedStatement, Object... params) throws SQLException, IntrospectionException, InvocationTargetException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchFieldException {        //注册驱动,获取连接        Connection connection = configuration.getDataSource().getConnection();        //获取sql语句:select * from user where id = #{id} and username = #{username}        //转换sql语句:select * from user where id = ? and username = ?        //转换的过程中,还需要对#{}里面的参数名称进行解析存储        String sql = mappedStatement.getSql();        BoundSql boundSql = getBoundSql(sql);        //获取预处理对象:preparedStatement        PreparedStatement preparedStatement = connection.prepareStatement(boundSql.getSqlText());        //设置参数        //获取到了参数的全路径        String parameterType = mappedStatement.getParameterType();        Class<?> parameterTypeClass = getClassType(parameterType);        List<ParameterMapping> parameterMappingList = boundSql.getParameterMappingList();        for (int i = 0; i < parameterMappingList.size(); i++) {            ParameterMapping parameterMapping = parameterMappingList.get(i);            String content = parameterMapping.getContent();            //反射            Field declaredField = parameterTypeClass.getDeclaredField(content);            //暴力访问            declaredField.setAccessible(true);            Object o = declaredField.get(params[0]);            preparedStatement.setObject(i + 1, o);        }        //执行sql        ResultSet resultSet = preparedStatement.executeQuery();        String resultType = mappedStatement.getResultType();        Class<?> resultTypeClass = getClassType(resultType);        List<Object> objectList = new ArrayList<>();        //封装返回结果集        while (resultSet.next()) {            Object o = resultTypeClass.newInstance();            //元数据            ResultSetMetaData metaData = resultSet.getMetaData();            for (int i = 1; i <= metaData.getColumnCount(); i++) {                // 字段名                String columnName = metaData.getColumnName(i);                // 字段的值                Object value = resultSet.getObject(columnName);                //使用反射或者内省,根据数据库表和实体的对应关系,完成封装                PropertyDescriptor propertyDescriptor = new PropertyDescriptor(columnName, resultTypeClass);                Method writeMethod = propertyDescriptor.getWriteMethod();                writeMethod.invoke(o, value);            }            objectList.add(o);        }        return (List<E>) objectList;    }    private Class<?> getClassType(String paramterType) throws ClassNotFoundException {        if (paramterType != null) {            Class<?> aClass = Class.forName(paramterType);            return aClass;        }        return null;    }        private BoundSql getBoundSql(String sql) {        //标记处理类:配置标记解析器来完成对占位符的解析处理工作        ParameterMappingTokenHandler parameterMappingTokenHandler = new ParameterMappingTokenHandler();        GenericTokenParser genericTokenParser = new GenericTokenParser("#{", "}", parameterMappingTokenHandler);        //解析出来的sql        String parseSql = genericTokenParser.parse(sql);        //#{}里面解析出来的参数名称        List<ParameterMapping> parameterMappings = parameterMappingTokenHandler.getParameterMappings();        BoundSql boundSql = new BoundSql(parseSql, parameterMappings);        return boundSql;    }}

BoundSql类

public class BoundSql {    private String sqlText; //解析过后的sql    private List<ParameterMapping> parameterMappingList = new ArrayList<>();    public BoundSql(String sqlText, List<ParameterMapping> parameterMappingList) {        this.sqlText = sqlText;        this.parameterMappingList = parameterMappingList;    }    public String getSqlText() {        return sqlText;    }    public void setSqlText(String sqlText) {        this.sqlText = sqlText;    }    public List<ParameterMapping> getParameterMappingList() {        return parameterMappingList;    }    public void setParameterMappingList(List<ParameterMapping> parameterMappingList) {        this.parameterMappingList = parameterMappingList;    }}

GenericTokenParser、ParameterMapping、TokenHandler、ParameterMappingTokenHandler工具类

  • GenericTokenParser:解析${}或#{}中的参数名称

  • ParameterMapping:存储${}或#{}中的参数名称

  • TokenHandler:替换${}或#{}处理接口

  • ParameterMappingTokenHandler:替换${}或#{}处理接口的实现类

public class GenericTokenParser {  private final String openToken; //开始标记  private final String closeToken; //结束标记  private final TokenHandler handler; //标记处理器  public GenericTokenParser(String openToken, String closeToken, TokenHandler handler) {    this.openToken = openToken;    this.closeToken = closeToken;    this.handler = handler;  }    public String parse(String text) {    // 验证参数问题,如果是null,就返回空字符串。    if (text == null || text.isEmpty()) {      return "";    }    // 下面继续验证是否包含开始标签,如果不包含,默认不是占位符,直接原样返回即可,否则继续执行。    int start = text.indexOf(openToken, 0);    if (start == -1) {      return text;    }   // 把text转成字符数组src,并且定义默认偏移量offset=0、存储最终需要返回字符串的变量builder,    // text变量中占位符对应的变量名expression。判断start是否大于-1(即text中是否存在openToken),如果存在就执行下面代码    char[] src = text.toCharArray();    int offset = 0;    final StringBuilder builder = new StringBuilder();    StringBuilder expression = null;    while (start > -1) {     // 判断如果开始标记前如果有转义字符,就不作为openToken进行处理,否则继续处理      if (start > 0 && src[start - 1] == '\\') {        builder.append(src, offset, start - offset - 1).append(openToken);        offset = start + openToken.length();      } else {        //重置expression变量,避免空指针或者老数据干扰。        if (expression == null) {          expression = new StringBuilder();        } else {          expression.setLength(0);        }        builder.append(src, offset, start - offset);        offset = start + openToken.length();        int end = text.indexOf(closeToken, offset);        while (end > -1) {////存在结束标记时          if (end > offset && src[end - 1] == '\\') {//如果结束标记前面有转义字符时            // this close token is escaped. remove the backslash and continue.            expression.append(src, offset, end - offset - 1).append(closeToken);            offset = end + closeToken.length();            end = text.indexOf(closeToken, offset);          } else {//不存在转义字符,即需要作为参数进行处理            expression.append(src, offset, end - offset);            offset = end + closeToken.length();            break;          }        }        if (end == -1) {          // close token was not found.          builder.append(src, start, src.length - start);          offset = src.length;        } else {          //首先根据参数的key(即expression)进行参数处理,返回?作为占位符          builder.append(handler.handleToken(expression.toString()));          offset = end + closeToken.length();        }      }      start = text.indexOf(openToken, offset);    }    if (offset < src.length) {      builder.append(src, offset, src.length - offset);    }    return builder.toString();  }}
public class ParameterMapping {    private String content;    public ParameterMapping(String content) {        this.content = content;    }    public String getContent() {        return content;    }    public void setContent(String content) {        this.content = content;    }}
public interface TokenHandler {  String handleToken(String content);}
public class ParameterMappingTokenHandler implements TokenHandler {private List<ParameterMapping> parameterMappings = new ArrayList<>();// context是参数名称 #{id} #{username}public String handleToken(String content) {parameterMappings.add(buildParameterMapping(content));return "?";}private ParameterMapping buildParameterMapping(String content) {ParameterMapping parameterMapping = new ParameterMapping(content);return parameterMapping;}public List<ParameterMapping> getParameterMappings() {return parameterMappings;}public void setParameterMappings(List<ParameterMapping> parameterMappings) {this.parameterMappings = parameterMappings;}}

以上就是关于“MyBatis如何实现自定义持久层框架”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注编程网精选频道。

--结束END--

本文标题: MyBatis如何实现自定义持久层框架

本文链接: https://www.lsjlt.com/news/330365.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • MyBatis如何实现自定义持久层框架
    这篇“MyBatis如何实现自定义持久层框架”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“MyBatis如何实现自定义持久层...
    99+
    2023-06-30
  • 解析MyBatis源码实现自定义持久层框架
    目录自定义框架设计自定义框架实现使用端框架端自定义框架设计 使用端 : 提供核⼼配置⽂件: sqlMapConfig.xml : 存放数据源信息,引⼊mapper.xml Mappe...
    99+
    2024-04-02
  • 【MyBatis】初识这一优秀的持久层框架
    学习目录 前言MyBatis简介快速入门映射文件sql片段与resultMap(🏳️‍🌈)MyBatis的增删改查1.添加操作2.修改操作3.删除操作 ...
    99+
    2023-10-24
    mybatis java mysql
  • Java持久层框架Mybatis入门详细教程
    mybatis介绍 mybatis它是轻量级持久层框架,由ibatis演化而来。它自动连接数据库,将数据库的结果集封装到对象中POJO。 POJO: 一个简单的Java类,这个类没...
    99+
    2024-04-02
  • MyBatis持久层框架详细解读:MyBatis快速入门篇
    文章目录 1. 前言 2. JDBC 存在的缺点 3. MyBatis 优化 4. MyBatis 快速入门 5. 总结 Java编程基础教程系列 1. 前言 JavaEE...
    99+
    2023-09-06
    mybatis java mysql maven
  • Mybatis持久层框架入门之CRUD实例代码详解
    目录1、MyBatis第一个程序1.1、代码演示1.2、问题说明2、CRUD操作2.1、namespace2.2、select2.3、insert2.4、update2.5...
    99+
    2024-04-02
  • 【MyBatis持久层框架】配置文件实现增删改查实战案例
    文章目录 1. 前言 2. 准备工作 3. 查询所有数据 3.1 编写接口方法 3.2 编写sql语句 3.3 编写测试方法 3.4 resultMap的使用 4. 查询详情 ...
    99+
    2023-08-17
    mybatis java 开发语言 maven
  • 【MyBatis持久层框架】配置文件实现增删改查实战案例(下)
    前言 前面我们学习了 MyBatis 持久层框架的原生开发方式和 Mapper 代理开发两种方式,解决了使用 JDBC 基础性代码操作数据库时存在的硬编码和操作繁琐的问题。 在配置文件实现增删改查上篇...
    99+
    2023-09-11
    mybatis java 数据库
  • Caffe框架中如何添加新的自定义层
    在Caffe框架中,要添加新的自定义层,需要进行以下步骤: 编写新的层类:在Caffe的src/caffe/layers目录下创...
    99+
    2024-04-02
  • MVC框架自定义实现过程
    1、思维导图 2、什么是MVC? MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写, 它是一种软...
    99+
    2024-04-02
  • SpringBoot2如何实现集成JPA持久层框架、简化数据库操作
    这篇文章主要为大家展示了“SpringBoot2如何实现集成JPA持久层框架、简化数据库操作”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“SpringBoot2如何实现集成JPA持久层框架、简化...
    99+
    2023-06-02
  • 一文了解自定义MVC框架实现
    目录一、让中央控制器动态加载存储子控制器二、参数传递封装优化三、对于方法执行结果转发重定向优化四、框架配置可变一、让中央控制器动态加载存储子控制器 上期回顾,我们说明了自定义MVC工...
    99+
    2024-04-02
  • Android Compose自定义TextField如何实现自定义的输入框
    这篇文章主要介绍Android Compose自定义TextField如何实现自定义的输入框,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!简单自定义BasicTextField示例代码 var&n...
    99+
    2023-06-29
  • Springboot如何实现自定义mybatis拦截器
    这篇文章将为大家详细讲解有关Springboot如何实现自定义mybatis拦截器,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。实践的准备 : 整合mybatis ,然后故意写了3个查询方法, ...
    99+
    2023-06-22
  • ionic如何实现自定义弹框效果
    这篇文章给大家分享的是有关ionic如何实现自定义弹框效果的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。思路利用ionic自带的弹框$ionicPopup。隐藏头部和尾部,只保留...
    99+
    2024-04-02
  • 如何理解持久化框架DataNucleus 3.0.8
    如何理解持久化框架DataNucleus 3.0.8,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。DataNucleus Access Platform 是一个兼容各种标准...
    99+
    2023-06-17
  • AndroidCompose自定义TextField实现自定义的输入框
    目录概览简单自定义BasicTextField示例实现自定义样式的BasicTextField使用BasicTextField自定义百度输入框概览 众所周知Compose中默认的Te...
    99+
    2024-04-02
  • Spring Data JPA框架的Repository自定义实现详解
    目录1. Spring Data Repository自定义实现1.1 自定义特殊repository1.2 配置类1.3 解决歧义1.4 手动装配1.5 自定义Base Repos...
    99+
    2024-04-02
  • MyBatis-Plus如何自定义SQL
    这篇文章主要为大家展示了“MyBatis-Plus如何自定义SQL”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“MyBatis-Plus如何自定义SQL”这篇文章吧。一、在src/main/re...
    99+
    2023-06-29
  • ONNX框架怎么支持自定义算子和扩展
    ONNX框架支持自定义算子和扩展,可以通过编写自定义算子并将其添加到ONNX的运行时中来实现。以下是一些实现自定义算子和扩展的步骤:...
    99+
    2024-04-08
    ONNX
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作