ORMS

CBORM logo

ColdBox offers a range of powerful features that enable developers to build high-quality database-centric applications quickly and efficiently. One of the standout features of ColdBox is its support for two native modules that use best-in-class ORM frameworks: Hibernate via cborm and Quick.

install cborm

CBORM is based on Hibernate, a popular ORM framework that simplifies database CRUD operations. It supports a wide range of database systems and provides an easy-to-use API that makes it simple for developers to interact with their databases. Hibernate is also highly configurable and can be customized to suit the specific needs of an application.

    // A quick preview of some functionality

	var book = new Book().findByTitle( "My Awesome Book" )
	var book = new Book().getOrFail( 2 )
	new Book().getOrFail( 4 ).delete()
	new Book().deleteWhere( isActive:false, isPublished:false )

	property name="userService" inject="entityService:User"

	return userService.list()
	return userService.list( asStream=true )

	var count = userService.countWhere( age:20, isActive:true )
	var users = userService.findAllByLastLoginBetween( "01/01/2019", "05/01/2019" )

	userService
		.newCriteria()
		.eq( "name", "luis" )
		.isTrue( "isActive" )
		.getOrFail()

	userService
		.newCriteria()
		.isTrue( "isActive" )
		.joinTo( "role" )
		.eq( "name", "admin" )
		.asStream()
		.list()

	userService
		.newCriteria()
		.withProjections( property="id,fname:firstName,lname:lastName,age" )
		.isTrue( "isActive" )
		.joinTo( "role" )
		.eq( "name", "admin" )
		.asStruct()
		.list()
Quick logo

Quick, on the other hand, is a lightweight ORM framework that provides a fast and efficient way to access databases. It offers a simple and intuitive API that makes it easy for developers to work with their databases. Quick is also highly flexible and can be easily integrated with other ColdBox modules and plugins.

install quick
    // User
	component extends="quick.models.BaseEntity" {
		// the name of the table is the pluralized version of the model
		// all fields in a table are mapped by default
		// both of these points can be configured on a per-entity basis
	}

	// handlers/Users.cfc
	component {

		// /users/:id
		function show( event, rc, prc ) {
			// this finds the User with an id of 1 and retrieves it
			prc.user = getInstance( "User" ).findOrFail( rc.id )
			event.setView( "users/show" )
		}
	}

So if you're looking for a powerful and flexible framework that simplifies database operations, ColdBox is the way to go. With its extensive ecosystem of modules, versatile architecture, and comprehensive documentation, ColdBox is the perfect tool for building modern, scalable, and maintainable applications.

Read more about Quick in its documentation, as well as CBORM.