<commit_before>/*
------------------------------------
JavaOnTracks          <NAME>
tcolar-jot AT colar DOT net
Artistic Licence 2.0
http://www.javaontracks.net
------------------------------------
 */
package net.jot.persistance;

import java.lang.reflect.Field;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

import net.jot.db.JOTDBField;
import net.jot.db.JOTDBJDBCSetup;
import net.jot.logger.JOTLogger;
import net.jot.persistance.query.JOTDBQueryImpl;
import net.jot.persistance.query.JOTFSQueryImpl;
import net.jot.persistance.query.JOTQueryInterface;
import net.jot.persistance.query.JOTQueryManager;

/**
 * Generic Persistance model<br>
 * Implementation for example include DB, filesystem etc ...<br>
 * If the table doesn't exists yet, it will be created automatically.
 * Note that if you change your model (add fields, rename fields etc.. you will have to handle changes in the upgrade() method.
 * @author <NAME> http://jot.colar.net/
 *
 * 
 * TODO: support/use transactionnal db queries
 * TODO: support join ?
 * TODO: if field is transient or starts with _ then ignore as a data field
 */
public abstract class JOTModel
{
    // lowercase -> actual field name mapping
    private Hashtable fieldNames;
    /**
     *  The "dataId" of the object in the database (ie: primary key)<commit_msg>mini server<commit_after>/*
------------------------------------
JavaOnTracks          <NAME>
tcolar-jot AT colar DOT net
Artistic Licence 2.0
http://www.javaontracks.net
------------------------------------
 */
package net.jot.persistance;

import java.lang.reflect.Field;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

import net.jot.db.JOTDBField;
import net.jot.db.JOTDBJDBCSetup;
import net.jot.logger.JOTLogger;
import net.jot.persistance.query.JOTDBQueryImpl;
import net.jot.persistance.query.JOTFSQueryImpl;
import net.jot.persistance.query.JOTQueryInterface;
import net.jot.persistance.query.JOTQueryManager;

/**
 * Generic Persistance model<br>
 * Implementation for example include DB, filesystem etc ...<br>
 * If the table doesn't exists yet, it will be created automatically.
 * Note that if you change your model (add fields, rename fields etc.. you will have to handle changes in the upgrade() method.
 * @author <NAME> http://jot.colar.net/
 *
 * 
 * TODO: support/use transactionnal db queries
 * TODO: support join ?
 * TODO: if field is transient or starts with _ then ignore as a data field
 * TODO: one has many belongTop etc ... ?
 */
public abstract class JOTModel
{
    // lowercase -> actual field name mapping
    private Hashtable fieldNames;
    /**
     *  The "dataId" of the object in the database (ie: primary key)
{'fraction_non_alphanumeric': 0.14725274725274726, 'fraction_numerical': 0.0014652014652014652, 'mean_word_length': 3.0822122571001493, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6255304', 'n_tokens_mistral': 831, 'n_tokens_neox': 810, 'n_words': 262}