agentsclimarketplace

Bx orm entities

Skill ortus-boxlang/skills/boxlang-modules/bx-orm/bx-orm-entities

BoxLang AI skills repository and Claude Plugin

Install
npx -y skills add ortus-boxlang/skills --skill bx-orm-entities

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use this skill when defining BoxLang ORM entities: the persistent annotation, entity names, table mapping, property annotations, fieldtype, ormType, identifiers/primary keys, composite keys, version fields, and entity inheritance.

SKILL.md

6.0 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

bx-orm: Entities & Properties

Defining a Persistent Entity

// Minimal entity — table name defaults to class file name
class persistent="true" {

}

// With explicit entity name and table
class persistent="true" entityName="Author" table="authors" {

}

Entity Annotations

AnnotationTypeDefaultDescription
persistentbooleanfalseMarks the class as an ORM entity
entityNamestringclass nameOverride the entity name
tablestringentity nameOverride the database table name
schemastringDatabase schema name
catalogstringDatabase catalog name
datasourcestringthis.datasourceOverride datasource per entity
readonlybooleanfalseMap to an existing table read-only
dynamicInsertbooleanfalseOnly INSERT non-null columns
dynamicUpdatebooleanfalseOnly UPDATE changed columns
cacheUsestring/booleanEnable L2 caching for this entity
cacheNamestringentity nameL2 cache region name
batchSizenumberHibernate batch fetch size

Defining Properties

All properties inside a persistent=true class are persistent by default:

class persistent="true" entityName="User" table="users" {

    // Primary key
    property name="id" fieldtype="id" type="numeric" generator="native";

    // Basic string column
    property name="username" type="string";

    // With explicit column name
    property name="createdAt" column="created_at" type="date" ormtype="timestamp";

    // Non-persistent (ignored by ORM)
    property name="transientHelper" persistent="false";

    // With default value (BoxLang side only, not DB-level)
    property name="isActive" type="boolean" default="true";

    // With DB-level default
    property name="createdOn" ormtype="datetime" dbdefault="'2024-01-01'";

    // Not-null constraint
    property name="email" type="string" notnull="true";

}

Property Annotations Reference

AnnotationExamplesDescription
name"userId"Property name
column"user_id"Database column name
typestring, numeric, dateBoxLang data type
ormTypebig_decimal, timestamp, textHibernate type
sqlTypenvarchar(100)Vendor-specific SQL type (DDL only)
fieldtypeid, column, one-to-many, etc.Field behavior
notnulltrueNOT NULL constraint
length255VARCHAR length
default"active"BoxLang property default
dbdefault"'pending'"Database column default
persistentfalseExclude this property from ORM
insertfalseExclude from INSERT
updatefalseExclude from UPDATE
uniquetrueUnique constraint
index"idx_email"Create an index

Identifiers (Primary Keys)

// Auto-increment (native — recommended)
property name="id" fieldtype="id" type="numeric" generator="native";

// UUID primary key
property name="id" fieldtype="id" type="string" generator="uuid";

// Assigned (you set the ID manually)
property name="id" fieldtype="id" type="string" generator="assigned";

// Sequence (for Oracle/PostgreSQL)
property name="id"
    fieldtype="id"
    type="numeric"
    generator="sequence"
    sequence="seq_users";

Generator values: native, identity, uuid, assigned, sequence, increment, hilo.

Composite Primary Keys

class persistent="true" entityName="OrderItem" table="order_items" {

    property name="orderId"   fieldtype="id" type="numeric" column="order_id";
    property name="productId" fieldtype="id" type="numeric" column="product_id";

    property name="quantity" type="numeric";
    property name="price"    type="numeric" ormtype="big_decimal";

}

Version / Optimistic Locking

class persistent="true" entityName="Product" {

    property name="id"      fieldtype="id" generator="native";
    property name="name"    type="string";
    property name="version" fieldtype="version" type="numeric";

}
// Hibernate increments version on every update.
// Throws StaleObjectStateException if two sessions modify the same row.

Timestamp Auto-Fields

property name="createdAt"  fieldtype="timestamp" generated="insert";
property name="updatedAt"  fieldtype="timestamp" generated="always";

Full Entity Example

class persistent="true" entityName="Post" table="blog_posts" {

    property name="id"
        fieldtype = "id"
        type      = "numeric"
        generator = "native";

    property name="title"
        type     = "string"
        length   = 200
        notnull  = "true";

    property name="body"
        type    = "string"
        ormtype = "text";

    property name="status"
        type    = "string"
        length  = 20
        default = "draft";

    property name="publishedAt"
        column  = "published_at"
        type    = "date"
        ormtype = "timestamp";

    property name="createdAt"
        column    = "created_at"
        ormtype   = "datetime"
        insert    = "true"
        update    = "false"
        dbdefault = "CURRENT_TIMESTAMP";

}

Common Pitfalls

  • ❌ Do NOT omit generator on fieldtype="id" — use native for auto-increment
  • ❌ Do NOT use type="date" when you need full datetime — use ormtype="timestamp"
  • ❌ Quote datetime dbdefault values: dbdefault="'2024-01-01'" (MySQL requires single-quoted strings)
  • ✅ Use persistent="false" for calculated properties or transient helpers
  • ✅ Use dynamicUpdate="true" on large entities where only a few columns change per save
  • ✅ Use insert="false" update="false" on columns that are managed by DB triggers

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,069. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.