.. java:import:: java.util Map MDSConstructor ============== .. java:package:: org.motechproject.mds.builder :noindex: .. java:type:: public interface MDSConstructor This interface provide method to create a class for the given entity. The implementation of this interface should also construct other classes like repository, service interface and implementation for this service interface. Methods ------- constructEntities ^^^^^^^^^^^^^^^^^ .. java:method:: boolean constructEntities(boolean buildDDE) :outertype: MDSConstructor Creates a class definition and insert it into the MDS class loader based on data from database. The implementation of this method should also create a repository, interface (when it's necessary) and implementation of this interface. After executing this method, there should be possible to create an instance of the given class definition and save it to database by \ :java:ref:`javax.jdo.PersistenceManager`\ provided by DataNucleus. An interface related with class definition should be created only for entities from outside bundles and if the bundle does not define its interface. :param buildDDE: \ ``true``\ if class definitions for entities from outside bundles should also be created; otherwise \ ``false``\ . :return: \ ``true``\ if there were entities for which class definitions should be created; otherwise \ ``false``\ . updateFields ^^^^^^^^^^^^ .. java:method:: void updateFields(Long entityId, Map fieldNameChanges) :outertype: MDSConstructor Updates the field names of an entity. This method changes the database schema by changing column names to the new value. This is done for the entity instances, history instances and trash instances. :param entityId: The ID of an entity to update :param fieldNameChanges: A map, indexed by current field names and values being updated field names.