在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:braisdom/ObjectiveSql开源软件地址:https://github.com/braisdom/ObjectiveSql开源编程语言:Java 100.0%开源软件介绍:ObjectiveSQL is an ORM framework in Java based on ActiveRecord pattern, which encourages rapid development and clean, codes with the least, and convention over configuration. Key Features
Why ObjectiveSQL
Performance(Oracle JMH)InstallationIntelliJ IDEA plugin installation
Maven dependencies<!-- In standalone -->
<dependency>
<groupId>com.github.braisdom</groupId>
<artifactId>objective-sql</artifactId>
<version>1.4.6</version>
</dependency> <!-- In Spring Boot -->
<dependency>
<groupId>com.github.braisdom</groupId>
<artifactId>objsql-springboot</artifactId>
<version>1.3.4</version>
</dependency> Refer to the pom.xml for more configuration ExamplesObjectiveSQL provides full example for various databases below, You can open it directly with IntelliJ IDEA as a standalone project. In fact, they are not just examples, but also unit tests of ObjectiveSQL in various databases. If you want to run without configuration, you can try: SQLite Others: MySQL, Oracle, MS SQL Server, PostgreSQL, Spring Boot Simple SQL programming without coding
@DomainModel
public class Member {
private String no;
@Queryable
private String name;
private Integer gender;
private String mobile;
private String otherInfo;
@Relation(relationType = RelationType.HAS_MANY)
private List<Order> orders;
} PersistenceMember.create(newMember);
Member.create(new Member[]{newMember1, newMember2, newMember3}, false);
Member.update(1L, newMember, true);
Member.update("name = 'Smith => Jackson'", "name = ?", "Alice");
Member.destroy(1L);
Member.destroy("name = ?", "Mary"); Counting and queryingMember.countAll();
Member.count("id > ?", 1);
Member.queryByPrimaryKey(1);
Member.queryFirst("id = ?", 1);
Member.query("id > ?", 1);
Member.queryAll(); Paged queryingPage page = Page.create(0, 10);
PagedList<Member> members = Member.pagedQueryAll(page, Member.HAS_MANY_ORDERS); Relation queryingMember.queryAll(Member.HAS_MANY_ORDERS);
Member.queryByPrimary(1, Member.HAS_MANY_ORDERS);
Member.queryByName("demo", Member.HAS_MANY_ORDERS);
... Complex SQL programmingOrder.Table orderTable = Order.asTable();
Select select = new Select();
// In ObjectiveSQL, Java operator can be overloaded
select.project(sum(orderTable.amount) / sum(orderTable.quantity) * 100)
.from(orderTable)
.where(orderTable.quantity > 30 &&
orderTable.salesAt.between("2020-10-10 00:00:00", "2020-10-30 23:59:59"))
.groupBy(orderTable.productId); SELECT SUM(`T0`.`amount`) / SUM(`T0`.`quantity`) * 100
FROM `orders` AS `T0`
WHERE `T0`.`quantity` > 30 AND
`T0`.`sales_at` BETWEEN '2020-10-10 00:00:00' AND '2020-10-30 23:59:59')
GROUP BY `T0`.`product_id` Reference documentation |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论