search
HomeDatabaseMysql Tutorial数据层框架guzz1.2.8 正式版发布 支持注解与动态SQL

guzz是一套用来解决ORM、多数据源管理、以及通用数据计算的数据层框架,为系统在数据层的设计提供一站式解决方案。guzz可以看作是 ibatis/hibernate的一大的延伸,并可以取代这2个东西。 guzz主要功能与特点: 现代大规模系统设计,技术上吸收了ibatis/hiber

guzz是一套用来解决ORM、多数据源管理、以及通用数据计算的数据层框架,为系统在数据层的设计提供一站式解决方案。guzz可以看作是 ibatis/hibernate的一大的延伸,并可以取代这2个东西。

guzz主要功能与特点:

    >现代大规模系统设计,技术上吸收了ibatis/hibernate的优点

    >支持像hibernate一样的对象化持久、映射和方便的增删改查

    >支持像ibatis一样,让dba参与sql设计的复杂数据库操作和优化

    >支持在线加载与调试SQL。按照应用策略,从文件/数据库/Web Service等途径,动态提取与使用SQL语句(Dynamic SQL)

    >支持应用程序使用大量的数据库和主从读写分离

    >支持超越范式的特殊关联、非结构化数据等异构资源的统一管理

    >支持数据表在多组机器间水平分布(Shard),并自动维护多组机器之间的分布式事务

    >支持1张表按照业务规则分切成多张小表(Shadow),并支持每张小表拥有自己特殊的属性字段(Custom)

    >支持组件化服务(SOA),构建企业/项目实施基础平台

    >支持配置管理服务器,可以使用一套软件系统对所有应用程序的配置进行统一管理

项目地址:http://code.google.com/p/guzz/

文档:http://code.google.com/p/guzz/wiki/WikiHomePage?tm=6

下载:http://code.google.com/p/guzz/downloads/list

1.2.8 更新介绍:

支持(JPA)annotation

支持按照JPA规范的annotation进行对象映射声明,同时为了实现guzz特有的功能,对annotation进行了扩展。扩展方式与hibernate类似,如果看到与hibernate annotation名字相同的注解,含义和用法也基本相同。

更多介绍请参看使用手册:
Guzz Annotation使用帮助:http://code.google.com/p/guzz/wiki/TutorialHbmAnnotation

Guzz Annotation参考手册:http://code.google.com/p/guzz/wiki/AppendJPAAnnotation

支持动态管理SQL:

动态SQL(Dynamic SQL)不是指应用程序动态的拼接SQL语句,动态SQL是指应用程序可以动态的获取配置好的SQL语句。在获取的过程中,SQL语句如何管理,由应用系统自身决定。

换句话说,在ibatis中,SQL语句配置到ibatis.xml文件中,在guzz中,配置到guzz.xml中。但当配置完成后,在系统运行期间这些SQL都是不能变动的,如果需要添加1个或者修改优化1个SQL语句,必须重启应用才能生效。而动态SQL允许应用系统动态的管理(添加/修改/优化/删除)sql语句以及查询结果到对象的映射关系(ORM),对于SQL的变更不再需要重启应用系统,以简化维护与应对需求变化。

动态SQL主要有两种应用场景:SQL优化和动态数据源。具体介绍请参看:http://code.google.com/p/guzz/wiki/TutorialDynamicSQLService

使用动态SQL的应用设计架构参考:http://guzz.javaeye.com/blog/675955

改进远程服务设计:

增加对hessian, burlap协议的支持。目前guzz内置支持phprpc, hessian, burlap三种协议进行RPC远程调用。使用时,三种协议可以透明替换,类似spring对RMI类协议的封装。具体介绍请参看:http://code.google.com/p/guzz/wiki/TutorialFutureService

增加枚举类型与类型参数化支持:

按照TopLink的模式,支持JDK5 enum。Enum在使用时和普通类型一样,不需要实现特殊的接口(hibernate要求实现接口)。Enum支持通过JPA的Enumeration注释声明,也支持在hbm.xml中通过xml定义。通过xml的定义方式参看:http://code.google.com/p/guzz/wiki/TutorialHbmXml

类型参数化为guzz的特殊功能,用于处理动态SQL参数和Jsp Taglib条件参数时,将String类型自动转换成需要的数据类型。参数化类型主要为日期和枚举。详细介绍:http://code.google.com/p/guzz/wiki/TutorialHbmXml

增加对数据库保留字的支持:

在定义数据库列名时,可以用`(ESC下面的键)将列名引起来,避免字段名称与数据库保留字冲突。此功能与hibernate提供的处理保留字方法相同,但guzz只支持字段,不支持`表名`。

增加对Microsoft SQL Server的支持(未测试):

参考hibernate实现了一个SQL Server 2000 & 2005的dialect,不支持分页。没有测试过。Dialect实现类:org.guzz.dialect.MSSQLDialect

Guzz已经能够支持的数据库和数据类型请参看:
http://code.google.com/p/guzz/wiki/TutorialGuzzXml

其他:

1. 文档进行了大范围的补充和更新;

2. 修复了所有已经发现的bug。

下一版本计划:
 
    >增加对spring事务的兼容。

    >设计一些常见的服务,推广guzz基础服务理念。

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How does MySQL handle concurrency compared to other RDBMS?How does MySQL handle concurrency compared to other RDBMS?Apr 29, 2025 am 12:44 AM

MySQLhandlesconcurrencyusingamixofrow-levelandtable-levellocking,primarilythroughInnoDB'srow-levellocking.ComparedtootherRDBMS,MySQL'sapproachisefficientformanyusecasesbutmayfacechallengeswithdeadlocksandlacksadvancedfeatureslikePostgreSQL'sSerializa

How does MySQL handle transactions compared to other relational databases?How does MySQL handle transactions compared to other relational databases?Apr 29, 2025 am 12:37 AM

MySQLhandlestransactionseffectivelyusingtheInnoDBengine,supportingACIDpropertiessimilartoPostgreSQLandOracle.1)MySQLusesREPEATABLEREADasthedefaultisolationlevel,whichcanbeadjustedtoREADCOMMITTEDforhigh-trafficscenarios.2)Itoptimizesperformancewithabu

How does MySQL differ from PostgreSQL?How does MySQL differ from PostgreSQL?Apr 29, 2025 am 12:23 AM

MySQLisbetterforspeedandsimplicity,suitableforwebapplications;PostgreSQLexcelsincomplexdatascenarioswithrobustfeatures.MySQLisidealforquickprojectsandread-heavytasks,whilePostgreSQLispreferredforapplicationsrequiringstrictdataintegrityandadvancedSQLf

How does MySQL handle data replication?How does MySQL handle data replication?Apr 28, 2025 am 12:25 AM

MySQL processes data replication through three modes: asynchronous, semi-synchronous and group replication. 1) Asynchronous replication performance is high but data may be lost. 2) Semi-synchronous replication improves data security but increases latency. 3) Group replication supports multi-master replication and failover, suitable for high availability requirements.

How can you use the EXPLAIN statement to analyze query performance?How can you use the EXPLAIN statement to analyze query performance?Apr 28, 2025 am 12:24 AM

The EXPLAIN statement can be used to analyze and improve SQL query performance. 1. Execute the EXPLAIN statement to view the query plan. 2. Analyze the output results, pay attention to access type, index usage and JOIN order. 3. Create or adjust indexes based on the analysis results, optimize JOIN operations, and avoid full table scanning to improve query efficiency.

How do you back up and restore a MySQL database?How do you back up and restore a MySQL database?Apr 28, 2025 am 12:23 AM

Using mysqldump for logical backup and MySQLEnterpriseBackup for hot backup are effective ways to back up MySQL databases. 1. Use mysqldump to back up the database: mysqldump-uroot-pmydatabase>mydatabase_backup.sql. 2. Use MySQLEnterpriseBackup for hot backup: mysqlbackup--user=root-password=password--backup-dir=/path/to/backupbackup. When recovering, use the corresponding life

What are some common causes of slow queries in MySQL?What are some common causes of slow queries in MySQL?Apr 28, 2025 am 12:18 AM

The main reasons for slow MySQL query include missing or improper use of indexes, query complexity, excessive data volume and insufficient hardware resources. Optimization suggestions include: 1. Create appropriate indexes; 2. Optimize query statements; 3. Use table partitioning technology; 4. Appropriately upgrade hardware.

What are views in MySQL?What are views in MySQL?Apr 28, 2025 am 12:04 AM

MySQL view is a virtual table based on SQL query results and does not store data. 1) Views simplify complex queries, 2) Enhance data security, and 3) Maintain data consistency. Views are stored queries in databases that can be used like tables, but data is generated dynamically.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.