Skip to content

Commit

Permalink
Merge pull request #42 from rareddy/TEIID-1854
Browse files Browse the repository at this point in the history
fixing classloading issues
  • Loading branch information
rareddy committed Jan 25, 2013
2 parents 44d94fb + 32db846 commit 7b70690
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
17 changes: 10 additions & 7 deletions odata/src/main/java/org/teiid/odata/ODataEntitySchemaBuilder.java
Expand Up @@ -201,21 +201,24 @@ private static void buildAssosiationSets(MetadataStore metadataStore, List<Build
.setType(refEntityType)
.setMultiplicity(EdmMultiplicity.ZERO_TO_ONE);

// Build ReferentialConstraint
EdmReferentialConstraint.Builder erc = EdmReferentialConstraint.newBuilder();
erc.setPrincipalRole(fk.getReferenceTableName());
erc.addPrincipalReferences(fk.getReferenceColumns());
erc.setDependentRole(table.getName());
erc.addDependentReferences(getColumnNames(fk.getColumns()));

// Build Association
EdmAssociation.Builder association = EdmAssociation.newBuilder();
association.setName(table.getName()+"_"+fk.getName());
association.setEnds(endSelf, endRef);
association.setNamespace(refEntityType.getFullyQualifiedTypeName().substring(0, refEntityType.getFullyQualifiedTypeName().indexOf('.')));
association.setRefConstraint(erc);
assosiations.add(association);

// Build ReferentialConstraint
if (fk.getReferenceColumns() != null) {
EdmReferentialConstraint.Builder erc = EdmReferentialConstraint.newBuilder();
erc.setPrincipalRole(fk.getReferenceTableName());
erc.addPrincipalReferences(fk.getReferenceColumns());
erc.setDependentRole(table.getName());
erc.addDependentReferences(getColumnNames(fk.getColumns()));
association.setRefConstraint(erc);
}

// Add EdmNavigationProperty to entity type
EdmNavigationProperty.Builder nav = EdmNavigationProperty.newBuilder(fk.getReferenceTableName());
nav.setRelationshipName(fk.getName());
Expand Down
Expand Up @@ -59,8 +59,8 @@ public ODataProducer getContext(Class<?> arg0) {

int versionIdx = vdbName.indexOf('.');
if (versionIdx != -1) {
vdbName = vdbName.substring(0, versionIdx);
version = Integer.parseInt(vdbName.substring(versionIdx+1));
vdbName = vdbName.substring(0, versionIdx);
}

vdbName = vdbName.trim();
Expand Down
2 changes: 1 addition & 1 deletion odata/src/main/webapp/META-INF/MANIFEST.MF
@@ -1,2 +1,2 @@
Manifest-Version: 1.0
Dependencies: org.jboss.teiid.admin,org.jboss.teiid.client,org.jboss.teiid,org.odata4j.core
Dependencies: org.jboss.teiid.admin,org.jboss.teiid.client,org.jboss.teiid,org.odata4j.core,org.jboss.teiid.translator.odata
2 changes: 0 additions & 2 deletions odata/src/test/java/org/teiid/odata/TestODataIntegration.java
Expand Up @@ -41,7 +41,6 @@
import org.jboss.resteasy.test.TestPortProvider;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.odata4j.core.*;
Expand All @@ -54,7 +53,6 @@
import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.unittest.RealMetadataFactory;

@Ignore
public class TestODataIntegration extends BaseResourceTest {

@BeforeClass
Expand Down

0 comments on commit 7b70690

Please sign in to comment.