protected Entity map(String tableName, String primaryKeyName, String sequenceName) { PersisterFactory.getPersister().registerEntity(this, tableName); PersisterFactory.getPersister() .registerPrimaryKey(this, primaryKey, primaryKeyName, sequenceName); PersisterFactory.getPersister().registerTimestamp(this, timeStamp, TIMESTAMP_NAME); return this; }
public <T extends Entity> Reference<T> referenceProperty( T referredEntity, String name, String mapping, String indexName, boolean required) { Reference<T> property = new Reference<T>(this.getId() + "." + name, referredEntity, this, required); property.setLocalizationKey(this.getId() + "." + name); properties.add(property); if (indexName == null) { PersisterFactory.getPersister().registerReference(this, property, mapping, referredEntity); } else { PersisterFactory.getPersister() .registerReference(this, property, mapping, referredEntity, indexName); } return property; }
public BinaryProperty binaryProperty(String name) { BinaryProperty property = new BinaryProperty(this.getId() + "." + name, this); property.setLocalizationKey(this.getId() + "." + name); properties.add(property); PersisterFactory.getPersister().registerProperty(this, property, name); return property; }
public <T extends Entity> Collection<T> reverseCollectionProperty( String name, T referredEntity, Reference<? extends Entity> referringColumn) { Collection<T> property = new Collection<T>(this.getId() + "." + name, referredEntity, this); property.setLocalizationKey(this.getId() + "." + name); properties.add(property); PersisterFactory.getPersister().registerReverseCollection(property, referringColumn); return property; }
public <T extends Entity> Collection<T> collectionProperty( T referredEntity, String name, String mapping, String indexName) { Collection<T> property = new Collection<T>(this.getId() + "." + name, referredEntity, this); property.setLocalizationKey(this.getId() + "." + name); properties.add(property); PersisterFactory.getPersister() .registerReference(referredEntity, property, mapping, this, indexName); return property; }
protected Entity(String name, String tableName, String primaryKeyName, String sequenceName) { super(name); setLocalizationKey(name); Property<Integer> pk = new Property<Integer>( this.getId() + "." + "PRIMARY_KEY", Integer.class, 0, true, this, false, null); primaryKey = pk; primaryKey.setLocalizationKey("ID"); Property<Date> ts = new Property<Date>( this.getId() + "." + TIMESTAMP_NAME, Date.class, 0, false, this, false, null); timeStamp = ts; timeStamp.setLocalizationKey("timeStamp"); PersisterFactory.getPersister().registerEntity(this, tableName); PersisterFactory.getPersister() .registerPrimaryKey(this, primaryKey, primaryKeyName, sequenceName); PersisterFactory.getPersister().registerTimestamp(this, timeStamp, TIMESTAMP_NAME); }
private <X extends Serializable> Property<X> addProperty( String name, Class<X> type, double size, boolean required, boolean virtual, String formatPattern) { Property<X> property = new Property<X>( this.getId() + "." + name, type, size, required, this, virtual, formatPattern); property.setLocalizationKey(this.getId() + "." + name); properties.add(property); if (!virtual) { PersisterFactory.getPersister().registerProperty(this, property, name); } return property; }
public View inheritanceView(View masterView, Property<String> discriminator, Enum<?> value) { View view = new SubView(masterView, discriminator, value); PersisterFactory.getPersister().addInheritanceIndex(this, discriminator); return view; }
public void addIndex(String name, boolean unique, Property<?>... properties) { PersisterFactory.getPersister().registerIndex(this, name, unique, properties); }