一种数据库访问代码自动生成方法

熊 伟, 欧阳逸, 张凌云

PDF(774 KB)
PDF(774 KB)
广州大学学报(自然科学版) ›› 2019, Vol. 18 ›› Issue (3) : 93-95.

一种数据库访问代码自动生成方法

  • 熊 伟, 欧阳逸*, 张凌云
作者信息 +

An automatic generation method of database access code

  • XIONG Wei, OUYANG Yi, ZHANG Ling-yun
Author information +
History +

摘要

使用ORM框架访问数据库效率较低,对执行效率有要求的项目一般采用纯手工编写数据库访问代码,但纯手工编写重复的数据库访问代码需要耗费大量时间.文章提出一种数据库访问代码自动生成方法,指出了自动生成代码需要解决的三个关键问题,并以SQL Server数据库为例,描述了生成C#代码的过程.使用数据库访问代码自动生成方法,生成的代码规范、易于维护,节省了程序员编码时间,提高了开发效率.

Abstract

Accessing the database using ORM framework is inefficient. Projects that require performance efficiency generally use hand-written database access code, but it takes a lot of time to manually write duplicate database access code. This paper proposes a database access code generation method, pointing out three key problems that need to be solved in this code generation method, and takes SQL Server database as an example to describe the process of generating C# code. Code generated by this database access code generation method is regular, easy to maintain, and it saves programmers coding time and improves development efficiency.

关键词

数据库 / 数据访问层 / ORM框架

Key words

database / data access layer / ORM framework

引用本文

导出引用
熊 伟, 欧阳逸, 张凌云. 一种数据库访问代码自动生成方法. 广州大学学报(自然科学版). 2019, 18(3): 93-95
XIONG Wei, OUYANG Yi, ZHANG Ling-yun. An automatic generation method of database access code. Journal of Guangzhou University(Natural Science Edition). 2019, 18(3): 93-95

参考文献

[1] Christian B,Gavin K,Gary G. Hibernate实战[M].2版.北京:清华大学出版社,2016.
[2] 汪鹏. 你必须掌握的Entity Framework 6.x与Core 2.0[M]. 北京:清华大学出版社,2018.
[3] Douglas L,Maira W,Craig G, et al. ADO.NET overview[EB/OL].[2017-03-30]. United States Washington:Microsoft Corporation. https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview.
[4] 徐郡明. Mybatis技术内幕[M]. 北京:电子工业出版社,2017.
[5] 崔玉连, 杨新锋. 数据库开发框架NHibernate应用研究[J]. 微型电脑应用, 2013(9): 12-14.
[6] 黄强,张晓梅,冉鸣,等.一个基于类型元数据的轻量级ORM框架设计[J].计算机工程,2007(22):54-56,59.
[7] 温皓晴,靳晓松.轻量级ORM数据访问框架SqlBuilder.NET的设计与实现[J].计算机与网络,2018,44(3):70-72.
[8] 周相兵,马洪江,苗放.云计算环境下的一种基于Hbase的ORM设计实现[J].西南师范大学学报(自然科学版),2013,38(8):130-135.
[9] 王博,舒新峰,王小银,等.自动代码生成技术的发展现状与趋势[J].西安邮电大学学报,2018,23(3):1-12.
[10]Wikipedia.Java database connectivity[G/OL].[2017-09-21]. Wikipedia website.https://en.wikipedia.org/wiki/Java_Database_Connectivity.
[11]Douglas L, Olprod, Saisang C. SQL Server 数据类型映射[EB/OL].[2017-03-30]. United States Washington:Microsoft Corporation,2017. Https://docs.microsoft.com/zh-cn/dotnet/framework/data/adonet/sql-server-data-type-mappings.

基金

大学生创新创业训练计划资助项目(201711078090)
PDF(774 KB)

149

Accesses

0

Citation

Detail

段落导航
相关文章

/