@Test public void testGetAgEntity_Relationships() { AgEntity<Ts> ts = metadata.getAgEntity(Ts.class); assertNotNull(ts); assertEquals("Ts", ts.getName()); assertSame(Ts.class, ts.getType()); assertEquals("Ts", ts.getName()); assertNotNull(ts.getAttribute("m")); assertNotNull(ts.getAttribute("n")); assertNotNull(ts.getRelationship("rtrs")); assertEquals(1, ts.getRelationships().size()); }
@Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } MetadataService(@Inject List<AgEntityCompiler> entityCompilers); }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } MetadataService(@Inject List<AgEntityCompiler> entityCompilers); @Override AgEntity<T> getAgEntity(Class<T> type); @Override AgEntity<T> getAgEntityByType(Type entityType); }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } MetadataService(@Inject List<AgEntityCompiler> entityCompilers); @Override AgEntity<T> getAgEntity(Class<T> type); @Override AgEntity<T> getAgEntityByType(Type entityType);  }