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

io.github.mmm.orm.sync.ModelSynchronizer Maven / Gradle / Ivy

There is a newer version: 0.9.8
Show newest version
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.orm.sync;

import io.github.mmm.entity.bean.EntityBean;

/**
 * Interface to synchronize the Java {@link EntityBean}-model with the DDL of your database.
* It will build the diff of your {@link EntityBean}-model and your DDL-models. All columns missing in one of the models * will be created in the other. So unlike hibernate hbm2dd auto feature it will synchronize bidirectional and also * creates properties in case of {@link EntityBean#isDynamic() dynamic} and {@link io.github.mmm.bean.VirtualBean * virtual} {@link EntityBean}s.
* ATTENTION:
* This feature is designed only for development and should not be used in production systems. */ public interface ModelSynchronizer { /** * Synchronizes all {@link EntityBean}s managed by a {@link io.github.mmm.orm.repository.EntityRepository * repository} that currently have an open transaction. */ void sync(); /** * @param entityClass the {@link Class} reflection the {@link EntityBean} to synchronize with the database (DDL). * @throws RuntimeException if no transaction is open for the according {@link io.github.mmm.orm.source.DbSource * database source}. */ void sync(Class entityClass); /** * @param entity the {@link EntityBean} to synchronize with the database (DDL). * @throws RuntimeException if no transaction is open for the according {@link io.github.mmm.orm.source.DbSource * database source}. */ void sync(EntityBean entity); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy