====== Schema ====== ''**public class Schema**'' \\ ''**implements Serializable**'' Schema describes an SQL schema determined with s set of relations over which attributes finite domain and foreign key constraints can be defined. {{ :magik-demo:developer:class:core:schema_and_relations.png?nolink&950 |}} ===== Class Attributes ===== private long id; private boolean localSchema; private java.lang.String name; private java.util.ArrayList relations; private java.util.ArrayList foreignKeys; private java.util.ArrayList finiteDomainConstraints; private java.util.ArrayList conjuctiveQueries; private java.util.ArrayList tcStatements; private java.lang.String dbUrl; private java.lang.String dbUser; private java.lang.String dbPassword; ===== Class Constructors ===== ==== Schema ==== public Schema () Default constructor ---- ==== Schema ==== public Schema (java.lang.String name, java.util.ArrayList relations, java.util.ArrayList foreignKeys, java.util.ArrayList finiteDomainConstraints, java.util.ArrayList conjuctiveQueries, java.util.ArrayList tcStatements) Constructor for creating a a database schema.\\ //Called by:// * it.unibz.inf.magik.test.TestQueryClass * it.unibz.inf.magik.test.TestQueryToSQL * it.unibz.inf.magik.test.TestFK * it.unibz.inf.magik.test.TestFK2 * it.unibz.inf.magik.test.TestTCQCReasonerBlackWhiteExample * it.unibz.inf.magik.test.TestTCQCReasonerPlainCompanyEx * it.unibz.inf.magik.test.TestQueryGeneralization * it.unibz.inf.magik.test.TestTCQCReasonerFKandFD * it.unibz.inf.magik.test.TestTCQCReasonerTCSuggestions * it.unibz.inf.magik.test.TestTCQCReasonerUnderFDC * it.unibz.inf.magik.test.TestQueryGeneralization * it.unibz.inf.magik.test.TestTCQCReasonerPlainSchoolEx * it.unibz.inf.magik.test.TestDatabaseConnectorClass **Parameters:** * relation - list of relation that are in the schema * foreignKeys - list of foreign keys related to the relations inside the schema * finiteDomainConstraints - list of finite domain constraints defined for the schema * conjuctiveQueries - list of the queries defined for the schema * tcStatements - list of table completeness statements defined for the schema ---- ==== Schema ==== public Schema (java.lang.String name, java.util.ArrayList relations, java.util.ArrayList foreignKeys, java.util.ArrayList finiteDomainConstraints) Constructor for creating a database schema with only relations, foreign keys and finite domain constraints defined.\\ //Called by:// * it.unibz.inf.magik.test.TestHardCaseFDCandFK * it.unibz.inf.magik.test.TestSimpleComparison * it.unibz.inf.magik.test.TestValQueryProblem * it.unibz.inf.magik.test.TestTCQCReasonerUnderFDC * it.unibz.inf.magik.test.TestPrimaryKeyViolation **Parameters:** * relation - list of relation that are in the schema * foreignKeys - list of foreign keys related to the relations inside the schema * finiteDomainConstraints - list of finite domain constraints defined for the schema ---- ==== Schema ==== public Schema (java.lang.String name, boolean localschema, java.util.ArrayList relations, java.util.ArrayList foreignKeys, java.util.ArrayList finiteDomainConstraints, java.util.ArrayList conjuctiveQueries, java.util.ArrayList tcStatements) Constructor that instantiates all the parts of the schema //Called by:// * it.unibz.inf.magik.web.SessionControl * it.unibz.inf.magik.web.SessionSchema **Parameters:** * name - name of the schema * localschema - //true// if the schema is local, //false// otherwise * relation - list of relation that are in the schema * foreignKeys - list of foreign keys related to the relations inside the schema * finiteDomainConstraints - list of finite domain constraints defined for the schema * conjunctiveQueries - list of the query defined for the schema * tcStatements - list of the table completeness statements for the schema ===== Class Methods ===== ==== findRelationByName ==== public Relation findRelationByName (java.lang.String relName) Given a relation name, if exists, it will answer with the relation structure. **Parameters:** * relName - relation name **Returns:** * Relation structure if exists, //null// otherwise ---- ==== getters and setters methods ==== public java.util.ArrayList getForeignKeys() public void setForeignKeys(java.util.ArrayList foreignKeys) public java.util.ArrayList getConjuctiveQueries() public void setConjuctiveQueries(java.util.ArrayList conjuctiveQueries) public java.util.ArrayList getTcStatements() public void setTcStatements(java.util.ArrayList tcStatements) public java.lang.String getName() public void setName(java.lang.String name) public java.util.ArrayList getRelations() public void setRelations(java.util.ArrayList relations) public java.util.ArrayList getFiniteDomainConstraints() public void setFiniteDomainConstraints(java.util.ArrayList finiteDomainConstraints) public boolean isLocalSchema() public void setLocalSchema(boolean localSchema) public java.lang.String getDbUrl() public void setDbUrl(java.lang.String dbUrl) public java.lang.String getDbUser() public void setDbUser(java.lang.String dbUser) public java.lang.String getDbPassword() public void setDbPassword(java.lang.String dbPassword) public long getId() public void setId(long id) [[magik-demo:developer:class:core:schema|Back to Top]] | [[magik-demo:start|Back to Home Page]]