All Projects → Cicinnus0407 → Zoom

Cicinnus0407 / Zoom

Google Room Persistence Library Extend.谷歌官方Room数据库扩展库

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Zoom

Flutter advanced networkimage
flutter advanced network image provider
Stars: ✭ 282 (+1126.09%)
Mutual labels:  zoom
Yeetgif
gif effects CLI. single binary, no dependencies. linux, osx, windows. #1 workplace productivity booster. #yeetgif #eggplant #golang
Stars: ✭ 467 (+1930.43%)
Mutual labels:  zoom
T Scroll
A modern reveal-on-scroll library with useful options and animations. (Animate Elements On Reveal)
Stars: ✭ 642 (+2691.3%)
Mutual labels:  zoom
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+1360.87%)
Mutual labels:  zoom
Chartjs Plugin Zoom
Zoom and pan plugin for Chart.js
Stars: ✭ 404 (+1656.52%)
Mutual labels:  zoom
React Use Gesture
👇Bread n butter utility for component-tied mouse/touch gestures in React and Vanilla Javascript.
Stars: ✭ 5,704 (+24700%)
Mutual labels:  zoom
Clean Notes
Clean Architecture by layer
Stars: ✭ 259 (+1026.09%)
Mutual labels:  room-persistence-library
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-21.74%)
Mutual labels:  room-persistence-library
Amplify
A tiny script allowing inline image zoom
Stars: ✭ 458 (+1891.3%)
Mutual labels:  zoom
React Svg Pan Zoom
👀 A React component that adds pan and zoom features to SVG
Stars: ✭ 569 (+2373.91%)
Mutual labels:  zoom
Zoomove
🔍 🎆 Enlarges the image with the mouse hover and move
Stars: ✭ 339 (+1373.91%)
Mutual labels:  zoom
React Image Magnify
A responsive image zoom component designed for shopping sites.
Stars: ✭ 391 (+1600%)
Mutual labels:  zoom
Pixi Viewport
A highly configurable viewport/2D camera designed to work with pixi.js
Stars: ✭ 532 (+2213.04%)
Mutual labels:  zoom
Expenso
📊 A Minimal Expense Tracker App built to demonstrate the use of modern android architecture component with MVVM Architecture
Stars: ✭ 325 (+1313.04%)
Mutual labels:  room-persistence-library
Mediumlightbox
Nice and elegant way to add zooming functionality for images, inspired by medium.com
Stars: ✭ 671 (+2817.39%)
Mutual labels:  zoom
React Native Image View
Modal component to view images with zoom
Stars: ✭ 273 (+1086.96%)
Mutual labels:  zoom
Instant Weather
An Android weather application implemented using the MVVM pattern, Retrofit2, Dagger2, LiveData, ViewModel, Coroutines, Room, Navigation Components, Data Binding and some other libraries from the Android Jetpack.
Stars: ✭ 473 (+1956.52%)
Mutual labels:  room-persistence-library
Image Zoom
🔎 Medium.com style image zoom for React 🔍
Stars: ✭ 920 (+3900%)
Mutual labels:  zoom
React Zmage
一个基于 React 的可缩放图片控件 | A scalable image wrapper power by react
Stars: ✭ 713 (+3000%)
Mutual labels:  zoom
Changedetection
Automatically track websites changes on Android in background.
Stars: ✭ 563 (+2347.83%)
Mutual labels:  room-persistence-library

Zoom Download

English DOC

Zoom是基于Room的功能扩展库.

欢迎PR/commit issue.

觉得好的可以点一下star.

如果希望对库进行改造,可以点一下fork

关于Zoom

使用扩展之前必须先对Room的基础使用有了解.

在Room原有的基础上扩展了一些基础功能方便使用 类似于Retrofit和OkHttp的关系(水平有限.代码当然没有Retrofit那么优雅)

通过APT+JavaPoet.编译时生成代码.

Room存在的问题以及Zoom出现的原因

存在的问题:

  • 虽然Room是一个ORM类型的数据库,但是对于数据库的操作基本都要通过原生SQL实现.

  • 最基础的CRUD操作都需要定义一个Room提供的注解方式.

  • 虽然对于@Insert,@Update,@Delete 的方法,能够在基类接口中定义.但是@query 需要具体的SQL语句.所以无法在基类仲定义

  • @RawQuery注解可以提供执行sql语句功能,但是每次简单的SQL都要手写.很枯燥并且没有太大没意义

  • 数据库升级非常麻烦.需要手动写很多SQL语句

如何解决:

  • 通过基类接口+APT生成表操作常用的CRUD方法

  • 编译时扫描实体对象,生成属性名和表列名的映射关系,生成条件搜索的对象,根据语义化的Java代码进行SQL查询

Zoom出现就是为了解决Room使用不便的问题

Zoom对象生成Java类名规则

  • 被@DaoExtend注解的接口编译后会生成类名+Extend的对象.

如 UserDao -> UserDaoExtend

  • 数据库实体编译后会生成 类名+Condition对象.

如 UserEntity -> UserEntityCondition


主要功能:

  • 添加了常用的基于对象的CRUD操作

    主键的Java类型会在编译期自动识别并生成对应参数类型

    • insert(T t);
    • selectById(Object Id);
    • delectBydi(Object id);
    • update(T t);
    • ..etc
  • 基础分页查询功能
    • selectByPageAndRows(int page,int rows);
  • 获取表数据条数
    • count();
  • 基于属性的对象查询
    • andEqulaTo(property,value);
    • andLike(property,value);
    • andIsNotNull(property);
    • orIsNull();
    • etc...
  • 直接SQL查询
    • andCondition(SQL statement);
    • orCondition(SQL statement);
  • LiveData支持
  • 数据库升级帮助类
  • Kotlin支持 (Planning)
  • RxJava2支持 (Planning)
  • AndroidX (undetermined)

引入依赖

1.引入Room数据库

dependencies {
    api 'android.arch.persistence.room:runtime:1.1.0'
    annotationProcessor 'android.arch.persistence.room:compiler:1.1.0'
}

2.添加Zoom的仓库地址.添加Zoom依赖

latest-version 是库的最新版本,请看标题的版本提示.

dependencies {
    api 'com.cicinnus.zoom:extend:latest-version'
    annotationProcessor 'com.cicinnus.zoom:compiler:latest-version'
}

简单使用示例

更多使用方法请查看sample


参考

Mybatis通用Mapper

Getting Class values from Annotations in an AnnotationProcessor

ANNOTATION PROCESSING 101

License

Copyright [2018] [r09er zhong]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].