Skip to content

Commit

Permalink
Remove populate(ExpSampleType) variant
Browse files Browse the repository at this point in the history
- setting the sample type is independent of populating the columns
  • Loading branch information
labkey-nicka committed Mar 20, 2024
1 parent ecb610a commit a45da85
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 181 deletions.
4 changes: 0 additions & 4 deletions api/src/org/labkey/api/exp/query/ExpMaterialTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

package org.labkey.api.exp.query;

import org.jetbrains.annotations.Nullable;
import org.labkey.api.data.UpdateableTableInfo;
import org.labkey.api.exp.api.ExpSampleType;

public interface ExpMaterialTable extends ExpTable<ExpMaterialTable.Column>, UpdateableTableInfo
{
Expand Down Expand Up @@ -63,6 +61,4 @@ enum Column
StoredAmount,
Units,
}

void populate(@Nullable ExpSampleType st);
}
3 changes: 1 addition & 2 deletions api/src/org/labkey/api/exp/query/ExpSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public TableInfo createTable(ExpSchema expSchema, String queryName, ContainerFil
public TableInfo createTable(ExpSchema expSchema, String queryName, ContainerFilter cf)
{
ExpMaterialTable ret = ExperimentService.get().createMaterialTable(expSchema, cf, null);
ret.populate(null);
return ret;
return expSchema.setupTable(ret);
}
},
MaterialInputs
Expand Down
10 changes: 5 additions & 5 deletions api/src/org/labkey/api/exp/query/SamplesSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public TableInfo createTable(String name, ContainerFilter cf)
}

@Override
public QueryView createView(ViewContext context, @NotNull QuerySettings settings, BindException errors)
public @NotNull QueryView createView(ViewContext context, @NotNull QuerySettings settings, BindException errors)
{
QueryView queryView = super.createView(context, settings, errors);

Expand All @@ -179,8 +179,8 @@ public ExpMaterialTable createSampleTable(@Nullable ExpSampleType st, ContainerF
if (log.isTraceEnabled())
log.trace("CREATE TABLE: " + (null==st ? "null" : st.getName()) + " schema=" + System.identityHashCode(this), new Throwable());

ExpMaterialTable ret = ExperimentService.get().createMaterialTable(this, cf, null);
ret.populate(st);
ExpMaterialTable ret = ExperimentService.get().createMaterialTable(this, cf, st);
ret.populate();
return ret;
}

Expand Down Expand Up @@ -209,8 +209,8 @@ public ForeignKey materialIdForeignKey(@Nullable final ExpSampleType st, @Nullab

private TableInfo createLookupTableInfo()
{
ExpMaterialTable ret = ExperimentService.get().createMaterialTable(SamplesSchema.this, getLookupContainerFilter(), null);
ret.populate(st);
ExpMaterialTable ret = ExperimentService.get().createMaterialTable(SamplesSchema.this, getLookupContainerFilter(), st);
ret.populate();
ret.overlayMetadata(ret.getPublicName(), SamplesSchema.this, new ArrayList<>());
if (domainProperty != null && domainProperty.getPropertyType().getJdbcType().isText())
{
Expand Down
4 changes: 2 additions & 2 deletions experiment/src/org/labkey/experiment/ParentChildView.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ else if (!typeName.equals(type))
protected TableInfo createTable()
{
// Use ContainerFilter.EVERYTHING - We've already set an IN clause that restricts us to showing just data that we have permission to view
ExpMaterialTable table = ExperimentServiceImpl.get().createMaterialTable(getSchema(), ContainerFilter.EVERYTHING, null);
table.populate(st);
ExpMaterialTable table = ExperimentServiceImpl.get().createMaterialTable(getSchema(), ContainerFilter.EVERYTHING, st);
table.populate();

List<FieldKey> defaultVisibleColumns = new ArrayList<>();
if (st == null)
Expand Down
Loading

0 comments on commit a45da85

Please sign in to comment.