All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.samskivert.depot.PersistentRecord Maven / Gradle / Ivy

The newest version!
//
// Depot library - a Java relational persistence library
// https://github.com/threerings/depot/blob/master/LICENSE

package com.samskivert.depot;

import com.samskivert.depot.expression.ColumnExp;
import com.samskivert.depot.impl.DepotUtil;
import com.samskivert.depot.impl.QueryResult;

/**
 * The base class for all persistent records used in Depot. Persistent records must be cloneable
 * and serializable; this class is used to enforce those requirements.
 */
public class PersistentRecord extends QueryResult
{
    // AUTO-GENERATED: FIELDS START
    public static final Class _R = PersistentRecord.class;
    // AUTO-GENERATED: FIELDS END

    /**
     * Creates a column expression for this class with the specified field name. Used by the
     * autogenerated column expression constants.
     */
    protected static  ColumnExp colexp (
        Class clazz, String fieldName)
    {
        return new ColumnExp(clazz, fieldName);
    }

    /**
     * Creates a new Key for this class. Called by autogenerated code, and placed here because
     * we hope to make this form of the Key constructor protected.
     */
    protected static  Key newKey (
        Class pClass, Comparable... values)
    {
        return new Key(pClass, values);
    }

    /**
     * Register the key fields for a subclass. Called by autogenerated code.
     */
    protected static void registerKeyFields (ColumnExp... fields)
    {
        DepotUtil.registerKeyFields(fields);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy