Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c4ac0d8
Add managed ORM sessions and relationship mappings across runtimes
shai-almog Sep 22, 2026
05a2274
Fix ORM documentation gates and native stack macro portability
shai-almog Sep 22, 2026
6d057a0
Fix managed ORM cast semantics and CI quality gates
shai-almog Sep 22, 2026
fb22377
Expose identifier character checks in the CLDC compiler API
shai-almog Sep 22, 2026
c6c3c2d
Fix ORM review findings in transaction and relationship handling
shai-almog Sep 22, 2026
55ba2f7
Separate ORM implementation details from documented public APIs
shai-almog Sep 23, 2026
2911201
Fix CI test isolation and generic API documentation anchors
shai-almog Sep 23, 2026
61c0ce9
Constrain ORM enhancer output and cleanup to the classes directory
shai-almog Sep 23, 2026
05665d1
Fix ORM cascade, lifecycle, conversion and connection review findings
shai-almog Sep 23, 2026
0c00790
Fix ORM query portability, list multiplicity and mapping validation
shai-almog Sep 23, 2026
b094a13
Fix ORM subtype updates, binding and managed ownership review findings
shai-almog Sep 23, 2026
f5c4ed8
Fix ORM insert lifecycle, cyclic keys and generated schema names
shai-almog Sep 23, 2026
dc99544
Fix ORM hierarchy generators, query portability and mapping validation
shai-almog Sep 23, 2026
e11fc2c
Fix ORM review findings and CI quality failures
shai-almog Sep 23, 2026
37b6d4f
Fix managed ORM query portability and relationship validation
shai-almog Sep 23, 2026
5528620
Fix ORM function validation, portable keys and review findings
shai-almog Sep 23, 2026
cafcd82
Validate ORM arithmetic, grouping and collection schemas
shai-almog Sep 23, 2026
803b773
Preserve ORM scalar types and validate query operands
shai-almog Sep 24, 2026
2d7c32d
Validate ORM projections and guard integral arithmetic overflow
shai-almog Sep 24, 2026
3cf1af5
Validate ORM query values and fix numeric literal typing
shai-almog Sep 24, 2026
3343aa3
Enforce portable ORM query, schema and mapping constraints
shai-almog Sep 24, 2026
1121e83
Fix ORM query validation and failed client commit recovery
shai-almog Sep 24, 2026
0c337cb
Validate ORM domain assignments and repair collection cascade flushes
shai-almog Sep 24, 2026
c58dd40
Convert mapped JPQL literals and preserve cascaded removals
shai-almog Sep 24, 2026
87f5d75
Handle callback cascades and validate portable ORM mappings
shai-almog Sep 24, 2026
407f77d
Enforce ORM integer ranges and consistent query mappings
shai-almog Sep 24, 2026
812bc8d
Validate ORM comparison domains and bulk query scopes
shai-almog Sep 24, 2026
0b66854
Fix update callback cascades and validate enum query values
shai-almog Sep 24, 2026
74db984
Fix ORM join reuse, bulk nullability, and relationship state handling
shai-almog Sep 24, 2026
fce9cf2
Fix scalar aggregate guarantees and validate ORM paths and nested keys
shai-almog Sep 24, 2026
d57cb43
Merge master into orm-managed-relations
shai-almog Sep 24, 2026
ebf3bb4
Fix joined predicate validation, grouped bindings, and ownership casc…
shai-almog Sep 24, 2026
ea81ddf
Fix wide counter deltas and defer auto-flush during merge
shai-almog Sep 24, 2026
94c8deb
Validate JPQL mapped values and preserve converter boundaries
shai-almog Sep 24, 2026
be329a2
Stabilize ORM flushes and guard numeric and incremental mappings
shai-almog Sep 25, 2026
7be9d1c
Reject unsupported generated IDs in managed client mappings
shai-almog Sep 25, 2026
75701f0
Fix ORM callback cascades, merge defaults, and binary identities
shai-almog Sep 25, 2026
a347472
Validate ORM bulk assignments and reconcile join-table removal cascades
shai-almog Sep 25, 2026
3934a43
Validate ORM operations before flushing and align key constraints
shai-almog Sep 25, 2026
fdb89f5
Reserve explicit transactions and fix ORM merge and Unicode identifiers
shai-almog Sep 25, 2026
4117450
Fix managed ORM validation, identity and fetch recovery
shai-almog Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
container: ghcr.io/codenameone/codenameone/pr-ci-container:latest
env:
# Java 8 uses the native locale for class-file names containing Unicode.
LANG: C.UTF-8
LC_ALL: C.UTF-8
defaults:
run:
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions CodenameOne/src/com/codename1/annotations/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
/// When false the column gets a `NOT NULL` constraint at table-create time.
boolean nullable() default true;

/// Creates a unique index when the managed schema is created.
boolean unique() default false;

/// Optional explicit SQL type. Use the SQLite type names (`TEXT`,
/// `INTEGER`, `REAL`, `BLOB`, `NUMERIC`). When blank the processor infers
/// the type from the field's Java type.
Expand Down
4 changes: 4 additions & 0 deletions CodenameOne/src/com/codename1/annotations/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
package com.codename1.annotations;

import com.codename1.annotations.db.Index;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down Expand Up @@ -57,4 +58,7 @@
public @interface Entity {
/// SQL table name. Defaults to the simple class name when blank.
String table() default "";
/// Additional indexes created with the entity table.
/// @return index declarations, empty by default
Index[] indexes() default {};
}
39 changes: 39 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/CascadeType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;

/// Operations propagated from an entity to its related entities.
public enum CascadeType {
/// Propagates all supported cascade operations.
ALL,
/// Persists new related entities.
PERSIST,
/// Merges related entity state.
MERGE,
/// Removes related entities.
REMOVE,
/// Reloads related entities from storage.
REFRESH,
/// Detaches already loaded related entities.
DETACH
}
37 changes: 37 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/Convert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
import com.codename1.orm.session.AttributeConverter;
/// A public no-arg converter for a basic field; converters also receive null values.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
public @interface Convert {
/// Selects the domain converter. It must be public with a public no-argument constructor.
/// Converters receive null values in both directions.
/// @return converter class
Class<? extends AttributeConverter> converter();
/// Declares the SQL scalar type returned by the converter.
/// @return storage class; String by default
Class<?> storageType() default String.class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
/// The persistent discriminator for a concrete class in an entity hierarchy.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface DiscriminatorValue {
/// Names the unique discriminator stored for this concrete entity class.
/// @return persistent discriminator value
String value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
/// Mapping for an owned collection of scalar values.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
public @interface ElementCollection {
/// Controls relationship initialization.
/// @return fetch policy; EAGER for to-one and LAZY for collections by default
FetchType fetch() default FetchType.LAZY;
/// Names the scalar value column in the collection table.
/// @return column name; element_value by default
String column() default "element_value";
}
29 changes: 29 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/Embeddable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
/// A reusable value object whose scalar fields are stored in its owner table.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface Embeddable {
}
29 changes: 29 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/Embedded.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
/// Flattens an embeddable value into the owner table using a field-name prefix.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
public @interface Embedded {
}
29 changes: 29 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/EmbeddedId.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
/// Flattens an embeddable identifier into the owner table using a field-name prefix.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
public @interface EmbeddedId {
}
31 changes: 31 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/FetchType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;

/// Controls when a mapped relationship is loaded.
public enum FetchType {
/// Initializes the relationship when its owner is loaded.
EAGER,
/// Defers loading until enhanced field access or explicit session initialization.
LAZY
}
36 changes: 36 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/GeneratedValue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;
import java.lang.annotation.*;
/// Overrides the legacy Id.autoIncrement strategy for this identifier.
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
public @interface GeneratedValue {
/// Chooses identifier generation, overriding Id.autoIncrement.
/// Generated composite identifiers are not supported.
/// @return generation strategy; IDENTITY by default
GenerationType strategy() default GenerationType.IDENTITY;
/// Names the counter used by SEQUENCE or TABLE generation.
/// @return counter name; empty derives a name from the table and key column
String generator() default "";
}
35 changes: 35 additions & 0 deletions CodenameOne/src/com/codename1/annotations/db/GenerationType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2026, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.annotations.db;

/// Identifier generation strategies for a single identifier field.
public enum GenerationType {
/// Uses a database-generated integral identity.
IDENTITY,
/// Assigns a generated UUID string.
UUID,
/// Uses a native PostgreSQL sequence, or the portable sequence table on other backends.
SEQUENCE,
/// Allocates integral identifiers using the portable sequence table.
TABLE
}
Loading
Loading