[go: up one dir, main page]

0% found this document useful (0 votes)
220 views2 pages

ADK Programming

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

1. Creating Objects and Connecting the Objects with relationship import com.matrixone.apps.domain.DomainObject; import com.matrixone.apps.domain.DomainRelationship; import matrix.db.

Context; import matrix.db.RelationshipType; import matrix.util.MatrixException; public class ConnectDatabase { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { @SuppressWarnings("deprecation") Context conObj = new Context(":bos","http://localhost:8080/enovia/"); conObj.setUser("creator"); conObj.setPassword(""); conObj.connect(); System.out.println("connected ..............."); DomainObject dobj=new DomainObject(); DomainObject dobj1=new DomainObject(); dobj.createObject(conObj,"Micro Computer","MC","A","ComputerPolicy","ComputerVault"); dobj1.createAndConnect(conObj,"System Box","SB","A","ComputerPolicy","ComputerVault","MicrocomputerAssembly",dobj,true); dobj1.createAndConnect(conObj,"Mouse","Mouse","A","ComputerPolicy","ComputerVault","Microcom puterAssembly",dobj,true); dobj1.createAndConnect(conObj,"Monitor","Monitor","A","ComputerPolicy","ComputerVault","Microc omputerAssembly",dobj,true); dobj1.createAndConnect(conObj,"Keyboard","KB","A","ComputerPolicy","ComputerVault","Microcomp uterAssembly",dobj,true); //findAndUpdateHighImpactProjects(context); conObj.disconnect(); } catch (MatrixException e) { // TODO Auto-generated catch block e.printStackTrace();

} } }

You might also like