Renamed Record to EntityProxy. Renamed classes with entity names -- for example, EmployeeRecord to EmployeeProxy. Also renamed variables in a few classes.
Renamed DataTransferObject -> ProxyFor.
patch by: amitmanjhi
Review by: rjrjr
Review at http://gwt-code-reviews.appspot.com/825802
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8711 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
index ce8204b..26d7a6b 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
@@ -24,7 +24,7 @@
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.requestfactory.client.RequestFactoryEditorDriver;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.SyncResult;
import com.google.gwt.sample.dynatablerf.client.events.EditPersonEvent;
import com.google.gwt.sample.dynatablerf.client.widgets.PersonEditor;
@@ -118,7 +118,7 @@
private void edit() {
// The request is configured arbitrarily
- RecordRequest<PersonProxy> fetchRequest = requestFactory.personRequest().findPerson(
+ ProxyRequest<PersonProxy> fetchRequest = requestFactory.personRequest().findPerson(
person.getId());
editorDriver = GWT.create(Driver.class);
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
index 4570958..2e1df02 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
@@ -152,7 +152,7 @@
void onPersonChanged(PersonProxyChanged event) {
if (WriteOperation.UPDATE.equals(event.getWriteOperation())) {
- PersonProxy record = event.getRecord();
+ PersonProxy record = event.getProxy();
// Is the changing record onscreen?
int displayOffset = offsetOf(record);
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxy.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxy.java
index f154010..ee85100 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxy.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxy.java
@@ -15,16 +15,16 @@
*/
package com.google.gwt.sample.dynatablerf.shared;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.sample.dynatablerf.domain.Address;
/**
* Represents an Address in the client code.
*/
-@DataTransferObject(Address.class)
-public interface AddressProxy extends Record {
+@ProxyFor(Address.class)
+public interface AddressProxy extends EntityProxy {
/*
* These property objects will soon no longer be necessary (and will no longer
* be public api).
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxyChanged.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxyChanged.java
index ef0d668..dd341ee 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxyChanged.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxyChanged.java
@@ -17,14 +17,14 @@
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
/**
* This class will no longer be necessary pending HandlerManager changes.
*/
public class AddressProxyChanged extends
- RecordChangedEvent<AddressProxy, AddressProxyChanged.Handler> {
+ EntityProxyChangedEvent<AddressProxy, AddressProxyChanged.Handler> {
/**
* Implemented by handlers of this type of event.
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/DynaTableRequestFactory.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/DynaTableRequestFactory.java
index ee02654..ddbb5ce 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/DynaTableRequestFactory.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/DynaTableRequestFactory.java
@@ -16,8 +16,8 @@
package com.google.gwt.sample.dynatablerf.shared;
import com.google.gwt.requestfactory.shared.Instance;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.Service;
@@ -36,7 +36,7 @@
*/
@Service(Address.class)
interface AddressRequest {
- RecordRequest<AddressProxy> findAddress(Long id);
+ ProxyRequest<AddressProxy> findAddress(Long id);
@Instance
RequestObject<Void> persist(AddressProxy person);
@@ -47,7 +47,7 @@
*/
@Service(Person.class)
interface PersonRequest {
- RecordRequest<PersonProxy> findPerson(Long id);
+ ProxyRequest<PersonProxy> findPerson(Long id);
@Instance
RequestObject<Void> persist(PersonProxy person);
@@ -59,7 +59,7 @@
@Service(SchoolCalendarService.class)
interface SchoolCalendarRequest {
// TODO(amitmanjhi, cromwellian) RequestObject<List<PersonProxy>>
- RecordListRequest<PersonProxy> getPeople(int startIndex, int maxCount);
+ ProxyListRequest<PersonProxy> getPeople(int startIndex, int maxCount);
}
AddressRequest addressRequest();
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxy.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxy.java
index bb58f30..0e828b7 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxy.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxy.java
@@ -15,16 +15,16 @@
*/
package com.google.gwt.sample.dynatablerf.shared;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.sample.dynatablerf.domain.Person;
/**
* Person DTO.
*/
-@DataTransferObject(Person.class)
-public interface PersonProxy extends Record {
+@ProxyFor(Person.class)
+public interface PersonProxy extends EntityProxy {
/*
* These property objects will soon no longer be necessary (and will no longer
* be public api).
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxyChanged.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxyChanged.java
index 6ab7568..2265144 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxyChanged.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/PersonProxyChanged.java
@@ -17,14 +17,14 @@
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
/**
* This class will no longer be necessary pending HandlerManager changes.
*/
public class PersonProxyChanged extends
- RecordChangedEvent<PersonProxy, PersonProxyChanged.Handler> {
+ EntityProxyChangedEvent<PersonProxy, PersonProxyChanged.Handler> {
/**
* Implemented by handlers of this type of event.
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java
index 98dd347..24a199b 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java
@@ -40,7 +40,7 @@
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.SyncResult;
import com.google.gwt.resources.client.ImageResource;
@@ -48,12 +48,12 @@
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecord;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecordChanged;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxy;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxyChanged;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
-import com.google.gwt.sample.expenses.client.request.ReportRecordChanged;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
+import com.google.gwt.sample.expenses.client.request.ReportProxyChanged;
import com.google.gwt.sample.expenses.client.style.Styles;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
@@ -90,7 +90,7 @@
* including the list of expenses.
*/
public class ExpenseDetails extends Composite
- implements ExpenseRecordChanged.Handler, ReportRecordChanged.Handler {
+ implements ExpenseProxyChanged.Handler, ReportProxyChanged.Handler {
interface Template extends SafeHtmlTemplates {
@Template("<select style=\"background-color:white;border:1px solid "
@@ -295,7 +295,7 @@
}
});
- private ExpenseRecord expenseRecord;
+ private ExpenseProxy expenseRecord;
private TextBox reasonBox = new TextBox();
private String reasonDenied;
@@ -319,7 +319,7 @@
5.0, Unit.PX);
}
- public ExpenseRecord getExpenseRecord() {
+ public ExpenseProxy getExpenseRecord() {
return expenseRecord;
}
@@ -332,7 +332,7 @@
reasonBox.setFocus(true);
}
- public void setExpenseRecord(ExpenseRecord expenseRecord) {
+ public void setExpenseRecord(ExpenseProxy expenseRecord) {
this.expenseRecord = expenseRecord;
}
@@ -397,7 +397,7 @@
Anchor reportsLink;
@UiField
- CellTable<ExpenseRecord> table;
+ CellTable<ExpenseProxy> table;
@UiField
Element unreconciledLabel;
@@ -409,7 +409,7 @@
/**
* The default {@link Comparator} used for sorting.
*/
- private Comparator<ExpenseRecord> defaultComparator;
+ private Comparator<ExpenseProxy> defaultComparator;
/**
* The popup used to display errors to the user.
@@ -426,20 +426,20 @@
/**
* The data provider that provides expense items.
*/
- private final ListDataProvider<ExpenseRecord> items;
+ private final ListDataProvider<ExpenseProxy> items;
/**
* The set of Expense keys that we have seen. When a new key is added, we
* compare it to the list of known keys to determine if it is new.
*/
- private Map<Object, ExpenseRecord> knownExpenseKeys = null;
+ private Map<Object, ExpenseProxy> knownExpenseKeys = null;
- private Comparator<ExpenseRecord> lastComparator;
+ private Comparator<ExpenseProxy> lastComparator;
/**
* Keep track of the last receiver so we can ignore stale responses.
*/
- private Receiver<List<ExpenseRecord>> lastReceiver;
+ private Receiver<List<ExpenseProxy>> lastReceiver;
/**
* The {@link Timer} used to periodically refresh the table.
@@ -454,7 +454,7 @@
/**
* The current report being displayed.
*/
- private ReportRecord report;
+ private ReportProxy report;
/**
* The total amount that has been approved.
@@ -464,7 +464,7 @@
public ExpenseDetails() {
createErrorPopup();
initWidget(uiBinder.createAndBindUi(this));
- items = new ListDataProvider<ExpenseRecord>();
+ items = new ListDataProvider<ExpenseProxy>();
items.setKeyProvider(Expenses.EXPENSE_RECORD_KEY_PROVIDER);
table.setKeyProvider(items);
items.addDataDisplay(table);
@@ -506,13 +506,13 @@
return reportsLink;
}
- public void onExpenseRecordChanged(ExpenseRecordChanged event) {
- ExpenseRecord newRecord = event.getRecord();
+ public void onExpenseRecordChanged(ExpenseProxyChanged event) {
+ ExpenseProxy newRecord = event.getProxy();
Object newKey = items.getKey(newRecord);
int index = 0;
- List<ExpenseRecord> list = items.getList();
- for (ExpenseRecord r : list) {
+ List<ExpenseProxy> list = items.getList();
+ for (ExpenseProxy r : list) {
if (items.getKey(r).equals(newKey)) {
list.set(index, newRecord);
@@ -532,16 +532,16 @@
}
}
- public void onReportChanged(ReportRecordChanged event) {
- ReportRecord changed = event.getRecord();
+ public void onReportChanged(ReportProxyChanged event) {
+ ReportProxy changed = event.getProxy();
if (report != null && report.getId().equals(changed.getId())) {
// Request the updated report.
expensesRequestFactory.reportRequest().findReport(
- report.getRef(ReportRecord.id)).with(
- ReportRecord.notes.getName()).fire(new Receiver<ReportRecord>() {
+ report.getRef(ReportProxy.id)).with(
+ ReportProxy.notes.getName()).fire(new Receiver<ReportProxy>() {
@Override
public void onSuccess(
- ReportRecord response, Set<SyncResult> syncResults) {
+ ReportProxy response, Set<SyncResult> syncResults) {
report = response;
setNotesEditState(false, false, response.getNotes());
}
@@ -555,14 +555,14 @@
}
/**
- * Set the {@link ReportRecord} to show.
+ * Set the {@link ReportProxy} to show.
*
- * @param report the {@link ReportRecord}
+ * @param report the {@link ReportProxy}
* @param department the selected department
* @param employee the selected employee
*/
public void setReportRecord(
- ReportRecord report, String department, EmployeeRecord employee) {
+ ReportProxy report, String department, EmployeeProxy employee) {
this.report = report;
knownExpenseKeys = null;
reportName.setInnerText(report.getPurpose());
@@ -591,9 +591,9 @@
}
@UiFactory
- CellTable<ExpenseRecord> createTable() {
+ CellTable<ExpenseProxy> createTable() {
CellTable.Resources resources = GWT.create(TableResources.class);
- CellTable<ExpenseRecord> view = new CellTable<ExpenseRecord>(
+ CellTable<ExpenseProxy> view = new CellTable<ExpenseProxy>(
100, resources);
Styles.Common common = Styles.common();
view.addColumnStyleName(0, common.spacerColumn());
@@ -604,17 +604,17 @@
view.addColumnStyleName(6, common.spacerColumn());
// Spacer column.
- view.addColumn(new SpacerColumn<ExpenseRecord>());
+ view.addColumn(new SpacerColumn<ExpenseProxy>());
// Created column.
- GetValue<ExpenseRecord, Date> createdGetter = new GetValue<
- ExpenseRecord, Date>() {
- public Date getValue(ExpenseRecord object) {
+ GetValue<ExpenseProxy, Date> createdGetter = new GetValue<
+ ExpenseProxy, Date>() {
+ public Date getValue(ExpenseProxy object) {
return object.getCreated();
}
};
defaultComparator = createColumnComparator(createdGetter, false);
- Comparator<ExpenseRecord> createdDesc = createColumnComparator(
+ Comparator<ExpenseProxy> createdDesc = createColumnComparator(
createdGetter, true);
addColumn(view, "Created",
new DateCell(DateTimeFormat.getFormat("MMM dd yyyy")), createdGetter,
@@ -623,34 +623,34 @@
// Description column.
addColumn(view, "Description", new TextCell(),
- new GetValue<ExpenseRecord, String>() {
- public String getValue(ExpenseRecord object) {
+ new GetValue<ExpenseProxy, String>() {
+ public String getValue(ExpenseProxy object) {
return object.getDescription();
}
});
// Category column.
addColumn(view, "Category", new TextCell(),
- new GetValue<ExpenseRecord, String>() {
- public String getValue(ExpenseRecord object) {
+ new GetValue<ExpenseProxy, String>() {
+ public String getValue(ExpenseProxy object) {
return object.getCategory();
}
});
// Amount column.
- final GetValue<ExpenseRecord, Double> amountGetter = new GetValue<
- ExpenseRecord, Double>() {
- public Double getValue(ExpenseRecord object) {
+ final GetValue<ExpenseProxy, Double> amountGetter = new GetValue<
+ ExpenseProxy, Double>() {
+ public Double getValue(ExpenseProxy object) {
return object.getAmount();
}
};
- Comparator<ExpenseRecord> amountAsc = createColumnComparator(
+ Comparator<ExpenseProxy> amountAsc = createColumnComparator(
amountGetter, false);
- Comparator<ExpenseRecord> amountDesc = createColumnComparator(
+ Comparator<ExpenseProxy> amountDesc = createColumnComparator(
amountGetter, true);
addColumn(view, "Amount", new NumberCell(NumberFormat.getCurrencyFormat()),
- new GetValue<ExpenseRecord, Number>() {
- public Number getValue(ExpenseRecord object) {
+ new GetValue<ExpenseProxy, Number>() {
+ public Number getValue(ExpenseProxy object) {
return amountGetter.getValue(object);
}
}, amountAsc, amountDesc);
@@ -660,7 +660,7 @@
denialPopup.addCloseHandler(new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
String reasonDenied = denialPopup.getReasonDenied();
- ExpenseRecord record = denialPopup.getExpenseRecord();
+ ExpenseProxy record = denialPopup.getExpenseRecord();
if (reasonDenied == null || reasonDenied.length() == 0) {
// We need to redraw the table to reset the select box.
syncCommit(record, null);
@@ -672,14 +672,14 @@
// Approval column.
approvalCell = new ApprovalCell();
- Column<ExpenseRecord, String> approvalColumn = addColumn(view,
- "Approval Status", approvalCell, new GetValue<ExpenseRecord, String>() {
- public String getValue(ExpenseRecord object) {
+ Column<ExpenseProxy, String> approvalColumn = addColumn(view,
+ "Approval Status", approvalCell, new GetValue<ExpenseProxy, String>() {
+ public String getValue(ExpenseProxy object) {
return object.getApproval();
}
});
- approvalColumn.setFieldUpdater(new FieldUpdater<ExpenseRecord, String>() {
- public void update(int index, final ExpenseRecord object, String value) {
+ approvalColumn.setFieldUpdater(new FieldUpdater<ExpenseProxy, String>() {
+ public void update(int index, final ExpenseProxy object, String value) {
if ("Denied".equals(value)) {
denialPopup.setExpenseRecord(object);
denialPopup.setReasonDenied(object.getReasonDenied());
@@ -691,7 +691,7 @@
});
// Spacer column.
- view.addColumn(new SpacerColumn<ExpenseRecord>());
+ view.addColumn(new SpacerColumn<ExpenseProxy>());
return view;
}
@@ -706,9 +706,9 @@
* @param getter the {@link GetValue} used to retrieve cell values
* @return the new column
*/
- private <C extends Comparable<C>> Column<ExpenseRecord, C> addColumn(
- final CellTable<ExpenseRecord> table, final String text,
- final Cell<C> cell, final GetValue<ExpenseRecord, C> getter) {
+ private <C extends Comparable<C>> Column<ExpenseProxy, C> addColumn(
+ final CellTable<ExpenseProxy> table, final String text,
+ final Cell<C> cell, final GetValue<ExpenseProxy, C> getter) {
return addColumn(table, text, cell, getter,
createColumnComparator(getter, false),
createColumnComparator(getter, true));
@@ -726,16 +726,16 @@
* @param descComparator the comparator used to sort ascending
* @return the new column
*/
- private <C> Column<ExpenseRecord, C> addColumn(
- final CellTable<ExpenseRecord> table, final String text,
- final Cell<C> cell, final GetValue<ExpenseRecord, C> getter,
- final Comparator<ExpenseRecord> ascComparator,
- final Comparator<ExpenseRecord> descComparator) {
+ private <C> Column<ExpenseProxy, C> addColumn(
+ final CellTable<ExpenseProxy> table, final String text,
+ final Cell<C> cell, final GetValue<ExpenseProxy, C> getter,
+ final Comparator<ExpenseProxy> ascComparator,
+ final Comparator<ExpenseProxy> descComparator) {
// Create the column.
- final Column<ExpenseRecord, C> column = new Column<ExpenseRecord, C>(cell) {
+ final Column<ExpenseProxy, C> column = new Column<ExpenseProxy, C>(cell) {
@Override
- public C getValue(ExpenseRecord object) {
+ public C getValue(ExpenseProxy object) {
return getter.getValue(object);
}
};
@@ -773,10 +773,10 @@
* @return the comparator
*/
private <C extends Comparable<C>> Comparator<
- ExpenseRecord> createColumnComparator(
- final GetValue<ExpenseRecord, C> getter, final boolean descending) {
- return new Comparator<ExpenseRecord>() {
- public int compare(ExpenseRecord o1, ExpenseRecord o2) {
+ ExpenseProxy> createColumnComparator(
+ final GetValue<ExpenseProxy, C> getter, final boolean descending) {
+ return new Comparator<ExpenseProxy>() {
+ public int compare(ExpenseProxy o1, ExpenseProxy o2) {
// Null check the row object.
if (o1 == null && o2 == null) {
return 0;
@@ -877,10 +877,10 @@
*/
private String[] getExpenseColumns() {
return new String[]{
- ExpenseRecord.amount.getName(), ExpenseRecord.approval.getName(),
- ExpenseRecord.category.getName(), ExpenseRecord.created.getName(),
- ExpenseRecord.description.getName(),
- ExpenseRecord.reasonDenied.getName()};
+ ExpenseProxy.amount.getName(), ExpenseProxy.approval.getName(),
+ ExpenseProxy.category.getName(), ExpenseProxy.created.getName(),
+ ExpenseProxy.description.getName(),
+ ExpenseProxy.reasonDenied.getName()};
}
/**
@@ -889,8 +889,8 @@
private void refreshCost() {
double totalCost = 0;
totalApproved = 0;
- List<ExpenseRecord> records = items.getList();
- for (ExpenseRecord record : records) {
+ List<ExpenseProxy> records = items.getList();
+ for (ExpenseProxy record : records) {
double cost = record.getAmount();
totalCost += cost;
if (Expenses.Approval.APPROVED.is(record.getApproval())) {
@@ -909,11 +909,11 @@
private void requestExpenses() {
// Cancel the timer since we are about to send a request.
refreshTimer.cancel();
- lastReceiver = new Receiver<List<ExpenseRecord>>() {
+ lastReceiver = new Receiver<List<ExpenseProxy>>() {
public void onSuccess(
- List<ExpenseRecord> newValues, Set<SyncResult> syncResults) {
+ List<ExpenseProxy> newValues, Set<SyncResult> syncResults) {
if (this == lastReceiver) {
- List<ExpenseRecord> list = new ArrayList<ExpenseRecord>(newValues);
+ List<ExpenseProxy> list = new ArrayList<ExpenseProxy>(newValues);
sortExpenses(list, lastComparator);
items.setList(list);
refreshCost();
@@ -921,17 +921,17 @@
// Add the new keys and changed values to the known keys.
boolean isInitialData = knownExpenseKeys == null;
if (knownExpenseKeys == null) {
- knownExpenseKeys = new HashMap<Object, ExpenseRecord>();
+ knownExpenseKeys = new HashMap<Object, ExpenseProxy>();
}
- for (ExpenseRecord value : newValues) {
+ for (ExpenseProxy value : newValues) {
Object key = items.getKey(value);
if (!isInitialData) {
- ExpenseRecord existing = knownExpenseKeys.get(key);
+ ExpenseProxy existing = knownExpenseKeys.get(key);
if (existing == null
|| !value.getAmount().equals(existing.getAmount())
|| !value.getDescription().equals(existing.getDescription())
|| !value.getCategory().equals(existing.getCategory())) {
- (new PhaseAnimation.CellTablePhaseAnimation<ExpenseRecord>(
+ (new PhaseAnimation.CellTablePhaseAnimation<ExpenseProxy>(
table, value, items)).run();
}
}
@@ -944,7 +944,7 @@
}
};
expensesRequestFactory.expenseRequest().findExpensesByReport(
- report.getRef(Record.id)).with(getExpenseColumns()).fire(lastReceiver);
+ report.getRef(EntityProxy.id)).with(getExpenseColumns()).fire(lastReceiver);
}
/**
@@ -963,7 +963,7 @@
// Submit the delta.
RequestObject<Void> editRequest = expensesRequestFactory.reportRequest().persist(report);
- ReportRecord editableReport = editRequest.edit(report);
+ ReportProxy editableReport = editRequest.edit(report);
editableReport.setNotes(pendingNotes);
editRequest.fire(new Receiver<Void>() {
public void onSuccess(Void ignore, Set<SyncResult> response) {
@@ -1007,7 +1007,7 @@
}
private void sortExpenses(
- List<ExpenseRecord> list, final Comparator<ExpenseRecord> comparator) {
+ List<ExpenseProxy> list, final Comparator<ExpenseProxy> comparator) {
lastComparator = comparator;
Collections.sort(list, comparator);
}
@@ -1015,10 +1015,10 @@
/**
* Update the state of a pending approval change.
*
- * @param record the {@link ExpenseRecord} to sync
+ * @param record the {@link ExpenseProxy} to sync
* @param message the error message if rejected, or null if accepted
*/
- private void syncCommit(ExpenseRecord record, String message) {
+ private void syncCommit(ExpenseProxy record, String message) {
final Object key = items.getKey(record);
if (message != null) {
final ApprovalViewData avd = approvalCell.getViewData(key);
@@ -1032,7 +1032,7 @@
}
private void updateExpenseRecord(
- final ExpenseRecord record, String approval, String reasonDenied) {
+ final ExpenseProxy record, String approval, String reasonDenied) {
// Verify that the total is under the cap.
if (Expenses.Approval.APPROVED.is(approval)
&& !Expenses.Approval.APPROVED.is(record.getApproval())) {
@@ -1047,7 +1047,7 @@
// Create a delta and sync with the value store.
RequestObject<Void> editRequest = expensesRequestFactory.expenseRequest().persist(record);
- ExpenseRecord editableRecord = editRequest.edit(record);
+ ExpenseProxy editableRecord = editRequest.edit(record);
editableRecord.setApproval(approval);
editableRecord.setReasonDenied(reasonDenied);
editRequest.fire(new Receiver<Void>() {
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseList.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseList.java
index 7b22e64..c42d15c 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseList.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseList.java
@@ -38,10 +38,10 @@
import com.google.gwt.requestfactory.shared.SyncResult;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
-import com.google.gwt.sample.expenses.client.request.ReportRecordChanged;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
+import com.google.gwt.sample.expenses.client.request.ReportProxyChanged;
import com.google.gwt.sample.expenses.client.style.Styles;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
@@ -71,7 +71,7 @@
* The list of expense reports on the right side of the app.
*/
public class ExpenseList extends Composite
- implements ReportRecordChanged.Handler {
+ implements ReportProxyChanged.Handler {
/**
* The auto refresh interval in milliseconds.
@@ -90,7 +90,7 @@
* @return the breadcrumb
*/
public static String getBreadcrumb(
- String department, EmployeeRecord employee) {
+ String department, EmployeeProxy employee) {
if (employee != null) {
return "Reports for " + employee.getDisplayName();
} else if (department != null) {
@@ -159,7 +159,7 @@
*
* @param report the selected report
*/
- void onReportSelected(ReportRecord report);
+ void onReportSelected(ReportProxy report);
}
/**
@@ -208,9 +208,9 @@
/**
* The data provider used to retrieve reports.
*/
- private class ReportDataProvider extends AsyncDataProvider<ReportRecord> {
+ private class ReportDataProvider extends AsyncDataProvider<ReportProxy> {
@Override
- protected void onRangeChanged(HasData<ReportRecord> display) {
+ protected void onRangeChanged(HasData<ReportProxy> display) {
requestReports(false);
}
}
@@ -229,7 +229,7 @@
* {@link UiBinder#createAndBindUi(Object)} because the pager depends on it.
*/
@UiField(provided = true)
- CellTable<ReportRecord> table;
+ CellTable<ReportProxy> table;
private List<SortableHeader> allHeaders = new ArrayList<SortableHeader>();
@@ -241,7 +241,7 @@
/**
* The employee being searched.
*/
- private EmployeeRecord employee;
+ private EmployeeProxy employee;
/**
* Indicates that the report count is stale.
@@ -251,7 +251,7 @@
/**
* The field to sort by.
*/
- private String orderBy = ReportRecord.purpose.getName();
+ private String orderBy = ReportProxy.purpose.getName();
/**
* The set of Report keys that we have seen. When a new key is added, we
@@ -262,7 +262,7 @@
/**
* Keep track of the last receiver so that we know if a response is stale.
*/
- private Receiver<List<ReportRecord>> lastDataReceiver;
+ private Receiver<List<ReportProxy>> lastDataReceiver;
/**
* Keep track of the last receiver so that we know if a response is stale.
@@ -286,8 +286,8 @@
* The columns to request with each report.
*/
private final String[] reportColumns = new String[]{
- ReportRecord.created.getName(), ReportRecord.purpose.getName(),
- ReportRecord.notes.getName()};
+ ReportProxy.created.getName(), ReportProxy.purpose.getName(),
+ ReportProxy.notes.getName()};
/**
* The data provider that provides reports.
@@ -346,14 +346,14 @@
});
}
- public void onReportChanged(ReportRecordChanged event) {
- ReportRecord changed = event.getRecord();
+ public void onReportChanged(ReportProxyChanged event) {
+ ReportProxy changed = event.getProxy();
Long changedId = changed.getId();
- List<ReportRecord> records = table.getDisplayedItems();
+ List<ReportProxy> records = table.getDisplayedItems();
int i = 0;
- for (ReportRecord record : records) {
+ for (ReportProxy record : records) {
if (record != null && changedId.equals(record.getId())) {
- List<ReportRecord> changedList = new ArrayList<ReportRecord>();
+ List<ReportProxy> changedList = new ArrayList<ReportProxy>();
changedList.add(changed);
reports.updateRowData(i + table.getPageStart(), changedList);
}
@@ -367,7 +367,7 @@
* @param department the department, or null if none selected
* @param employee the employee, or null if none selected
*/
- public void setEmployee(String department, EmployeeRecord employee) {
+ public void setEmployee(String department, EmployeeProxy employee) {
this.department = department;
this.employee = employee;
isCountStale = true;
@@ -408,12 +408,12 @@
* @param property the property to sort by
* @return the column
*/
- private <C> Column<ReportRecord, C> addColumn(final String text,
- final Cell<C> cell, final GetValue<ReportRecord, C> getter,
+ private <C> Column<ReportProxy, C> addColumn(final String text,
+ final Cell<C> cell, final GetValue<ReportProxy, C> getter,
final Property<?> property) {
- final Column<ReportRecord, C> column = new Column<ReportRecord, C>(cell) {
+ final Column<ReportProxy, C> column = new Column<ReportProxy, C>(cell) {
@Override
- public C getValue(ReportRecord object) {
+ public C getValue(ReportProxy object) {
return getter.getValue(object);
}
};
@@ -421,7 +421,7 @@
allHeaders.add(header);
// Sort created by default.
- if (property == ReportRecord.created) {
+ if (property == ReportProxy.created) {
header.setSorted(true);
header.setReverseSort(true);
orderBy = property.getName() + " DESC";
@@ -462,7 +462,7 @@
*/
private void createTable() {
CellTable.Resources resources = GWT.create(TableResources.class);
- table = new CellTable<ReportRecord>(20, resources);
+ table = new CellTable<ReportProxy>(20, resources);
Styles.Common common = Styles.common();
table.addColumnStyleName(0, common.spacerColumn());
table.addColumnStyleName(1, common.expenseListPurposeColumn());
@@ -471,56 +471,56 @@
table.addColumnStyleName(5, common.spacerColumn());
// Add a selection model.
- final NoSelectionModel<ReportRecord> selectionModel = new NoSelectionModel<
- ReportRecord>();
+ final NoSelectionModel<ReportProxy> selectionModel = new NoSelectionModel<
+ ReportProxy>();
table.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(
new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
Object selected = selectionModel.getLastSelectedObject();
if (selected != null && listener != null) {
- listener.onReportSelected((ReportRecord) selected);
+ listener.onReportSelected((ReportProxy) selected);
}
}
});
// Spacer column.
- table.addColumn(new SpacerColumn<ReportRecord>());
+ table.addColumn(new SpacerColumn<ReportProxy>());
// Purpose column.
addColumn(
- "Purpose", new HighlightCell(), new GetValue<ReportRecord, String>() {
- public String getValue(ReportRecord object) {
+ "Purpose", new HighlightCell(), new GetValue<ReportProxy, String>() {
+ public String getValue(ReportProxy object) {
return object.getPurpose();
}
- }, ReportRecord.purpose);
+ }, ReportProxy.purpose);
// Notes column.
addColumn(
- "Notes", new HighlightCell(), new GetValue<ReportRecord, String>() {
- public String getValue(ReportRecord object) {
+ "Notes", new HighlightCell(), new GetValue<ReportProxy, String>() {
+ public String getValue(ReportProxy object) {
return object.getNotes();
}
- }, ReportRecord.notes);
+ }, ReportProxy.notes);
// Department column.
addColumn(
- "Department", new TextCell(), new GetValue<ReportRecord, String>() {
- public String getValue(ReportRecord object) {
+ "Department", new TextCell(), new GetValue<ReportProxy, String>() {
+ public String getValue(ReportProxy object) {
return object.getDepartment();
}
- }, ReportRecord.department);
+ }, ReportProxy.department);
// Created column.
addColumn("Created", new DateCell(DateTimeFormat.getFormat("MMM dd yyyy")),
- new GetValue<ReportRecord, Date>() {
- public Date getValue(ReportRecord object) {
+ new GetValue<ReportProxy, Date>() {
+ public Date getValue(ReportProxy object) {
return object.getCreated();
}
- }, ReportRecord.created);
+ }, ReportProxy.created);
// Spacer column.
- table.addColumn(new SpacerColumn<ReportRecord>());
+ table.addColumn(new SpacerColumn<ReportProxy>());
}
/**
@@ -580,9 +580,9 @@
}
// Request reports in the current range.
- lastDataReceiver = new Receiver<List<ReportRecord>>() {
+ lastDataReceiver = new Receiver<List<ReportProxy>>() {
public void onSuccess(
- List<ReportRecord> newValues, Set<SyncResult> syncResults) {
+ List<ReportProxy> newValues, Set<SyncResult> syncResults) {
if (this == lastDataReceiver) {
int size = newValues.size();
if (size < table.getPageSize()) {
@@ -598,10 +598,10 @@
if (knownReportKeys == null) {
knownReportKeys = new HashSet<Object>();
}
- for (ReportRecord value : newValues) {
+ for (ReportProxy value : newValues) {
Object key = reports.getKey(value);
if (!isInitialData && !knownReportKeys.contains(key)) {
- (new PhaseAnimation.CellTablePhaseAnimation<ReportRecord>(
+ (new PhaseAnimation.CellTablePhaseAnimation<ReportProxy>(
table, value, reports)).run();
}
knownReportKeys.add(key);
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseTree.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseTree.java
index 815b742..90bd469 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseTree.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseTree.java
@@ -26,7 +26,7 @@
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
import com.google.gwt.sample.expenses.client.style.Styles;
import com.google.gwt.user.cellview.client.CellTree;
@@ -66,16 +66,17 @@
* @param department the selected department name
* @param employee the selected employee
*/
- void onSelection(String department, EmployeeRecord employee);
+ void onSelection(String department, EmployeeProxy employee);
}
/**
- * A {@link AbstractCell} that represents an {@link EmployeeRecord}.
+ * A {@link AbstractCell} that represents an {@link EmployeeProxy}.
*/
- private class EmployeeCell extends IconCellDecorator<EmployeeRecord> {
+ private class EmployeeCell extends IconCellDecorator<EmployeeProxy> {
public EmployeeCell() {
- super(Styles.resources().userIcon(), new AbstractCell<EmployeeRecord>() {
+ super(Styles.resources().userIcon(), new AbstractCell<EmployeeProxy>() {
+
private final String usernameStyle = Styles.common().usernameTreeItem();
private final String usernameStyleSelected =
Styles.common().usernameTreeItemSelected();
@@ -87,7 +88,7 @@
@Override
public void render(
- EmployeeRecord value, Object viewData, SafeHtmlBuilder sb) {
+ EmployeeProxy value, Object viewData, SafeHtmlBuilder sb) {
if (value != null) {
StringBuilder classesBuilder = new StringBuilder(usernameStyle);
if (lastEmployee != null
@@ -111,7 +112,7 @@
* The {@link ListDataProvider} used for Employee lists.
*/
private class EmployeeListDataProvider extends AsyncDataProvider<
- EmployeeRecord> implements Receiver<List<EmployeeRecord>> {
+ EmployeeProxy> implements Receiver<List<EmployeeProxy>> {
private final String department;
@@ -120,7 +121,7 @@
}
@Override
- public void addDataDisplay(HasData<EmployeeRecord> display) {
+ public void addDataDisplay(HasData<EmployeeProxy> display) {
super.addDataDisplay(display);
// Request the count anytime a view is added.
@@ -133,12 +134,12 @@
}
public void onSuccess(
- List<EmployeeRecord> response, Set<SyncResult> syncResults) {
+ List<EmployeeProxy> response, Set<SyncResult> syncResults) {
updateRowData(0, response);
}
@Override
- protected void onRangeChanged(HasData<EmployeeRecord> view) {
+ protected void onRangeChanged(HasData<EmployeeProxy> view) {
Range range = view.getVisibleRange();
requestFactory.employeeRequest().findEmployeeEntriesByDepartment(
department, range.getStart(), range.getLength()).with(
@@ -173,7 +174,7 @@
// Second level.
EmployeeListDataProvider dataProvider = new EmployeeListDataProvider(
(String) value);
- return new DefaultNodeInfo<EmployeeRecord>(
+ return new DefaultNodeInfo<EmployeeProxy>(
dataProvider, employeeCell, selectionModel, null);
}
@@ -214,7 +215,7 @@
/**
* The last selected employee.
*/
- private EmployeeRecord lastEmployee;
+ private EmployeeProxy lastEmployee;
/**
* The listener of this widget.
@@ -274,8 +275,8 @@
if (selected == null) {
lastEmployee = null;
lastDepartment = null;
- } else if (selected instanceof EmployeeRecord) {
- lastEmployee = (EmployeeRecord) selected;
+ } else if (selected instanceof EmployeeProxy) {
+ lastEmployee = (EmployeeProxy) selected;
} else if (selected instanceof String) {
lastEmployee = null;
if (model.isAllDepartment(selected)) {
@@ -292,9 +293,9 @@
});
selectionModel.setKeyProvider(new ProvidesKey<Object>() {
public Object getKey(Object item) {
- if (item instanceof EmployeeRecord) {
+ if (item instanceof EmployeeProxy) {
return Expenses.EMPLOYEE_RECORD_KEY_PROVIDER.getKey(
- (EmployeeRecord) item);
+ (EmployeeProxy) item);
}
return item;
}
@@ -308,7 +309,7 @@
private String[] getEmployeeMenuProperties() {
return new String[]{
- EmployeeRecord.displayName.getName(),
- EmployeeRecord.userName.getName()};
+ EmployeeProxy.displayName.getName(),
+ EmployeeProxy.userName.getName()};
}
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/Expenses.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/Expenses.java
index 9107852..b062777 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/Expenses.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/Expenses.java
@@ -23,16 +23,16 @@
import com.google.gwt.requestfactory.shared.Receiver;
import com.google.gwt.requestfactory.shared.RequestEvent;
import com.google.gwt.requestfactory.shared.SyncResult;
-import com.google.gwt.requestfactory.shared.UserInformationRecord;
+import com.google.gwt.requestfactory.shared.UserInformationProxy;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecord;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecordChanged;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxy;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxyChanged;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
-import com.google.gwt.sample.expenses.client.request.ReportRecordChanged;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
+import com.google.gwt.sample.expenses.client.request.ReportProxyChanged;
import com.google.gwt.sample.expenses.client.style.Styles;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
@@ -101,37 +101,37 @@
"Engineering", "Finance", "Marketing", "Operations", "Sales"};
/**
- * The key provider for {@link EmployeeRecord}s.
+ * The key provider for {@link EmployeeProxy}s.
*/
- public static final ProvidesKey<EmployeeRecord> EMPLOYEE_RECORD_KEY_PROVIDER =
- new ProvidesKey<EmployeeRecord>() {
- public Object getKey(EmployeeRecord item) {
+ public static final ProvidesKey<EmployeeProxy> EMPLOYEE_RECORD_KEY_PROVIDER =
+ new ProvidesKey<EmployeeProxy>() {
+ public Object getKey(EmployeeProxy item) {
return item == null ? null : item.getId();
}
};
/**
- * The key provider for {@link ExpenseRecord}s.
+ * The key provider for {@link ExpenseProxy}s.
*/
- public static final ProvidesKey<ExpenseRecord> EXPENSE_RECORD_KEY_PROVIDER =
- new ProvidesKey<ExpenseRecord>() {
- public Object getKey(ExpenseRecord item) {
+ public static final ProvidesKey<ExpenseProxy> EXPENSE_RECORD_KEY_PROVIDER =
+ new ProvidesKey<ExpenseProxy>() {
+ public Object getKey(ExpenseProxy item) {
return item == null ? null : item.getId();
}
};
/**
- * The key provider for {@link ReportRecord}s.
+ * The key provider for {@link ReportProxy}s.
*/
- public static final ProvidesKey<ReportRecord> REPORT_RECORD_KEY_PROVIDER =
- new ProvidesKey<ReportRecord>() {
- public Object getKey(ReportRecord item) {
+ public static final ProvidesKey<ReportProxy> REPORT_RECORD_KEY_PROVIDER =
+ new ProvidesKey<ReportProxy>() {
+ public Object getKey(ReportProxy item) {
return item == null ? null : item.getId();
}
};
private String lastDepartment;
- private EmployeeRecord lastEmployee;
+ private EmployeeProxy lastEmployee;
private ExpensesRequestFactory requestFactory;
private ExpensesShell shell;
@@ -161,9 +161,8 @@
// Add a login widget to the page
final LoginWidget login = shell.getLoginWidget();
- Receiver<UserInformationRecord> receiver = new Receiver<UserInformationRecord>() {
- public void onSuccess(UserInformationRecord userInformationRecord,
- Set<SyncResult> syncResults) {
+ Receiver<UserInformationProxy> receiver = new Receiver<UserInformationProxy>() {
+ public void onSuccess(UserInformationProxy userInformationRecord, Set<SyncResult> syncResults) {
login.setUserInformation(userInformationRecord);
}
};
@@ -172,7 +171,7 @@
// Listen for requests from ExpenseTree.
expenseTree.setListener(new ExpenseTree.Listener() {
- public void onSelection(String department, EmployeeRecord employee) {
+ public void onSelection(String department, EmployeeProxy employee) {
lastDepartment = department;
lastEmployee = employee;
expenseList.setEmployee(department, employee);
@@ -183,17 +182,17 @@
// Listen for requests from the ExpenseList.
expenseList.setListener(new ExpenseList.Listener() {
- public void onReportSelected(ReportRecord report) {
+ public void onReportSelected(ReportProxy report) {
expenseDetails.setExpensesRequestFactory(requestFactory);
expenseDetails.setReportRecord(report, lastDepartment, lastEmployee);
shell.showExpenseDetails(true);
}
});
expenseList.setRequestFactory(requestFactory);
- eventBus.addHandler(ReportRecordChanged.TYPE, expenseList);
+ eventBus.addHandler(ReportProxyChanged.TYPE, expenseList);
// Forward change events to the expense details.
- eventBus.addHandler(ExpenseRecordChanged.TYPE, expenseDetails);
- eventBus.addHandler(ReportRecordChanged.TYPE, expenseDetails);
+ eventBus.addHandler(ExpenseProxyChanged.TYPE, expenseDetails);
+ eventBus.addHandler(ReportProxyChanged.TYPE, expenseDetails);
}
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobile.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobile.java
index 3e5a8fd..d34ea9f 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobile.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobile.java
@@ -23,9 +23,9 @@
import com.google.gwt.requestfactory.shared.Receiver;
import com.google.gwt.requestfactory.shared.RequestEvent;
import com.google.gwt.requestfactory.shared.SyncResult;
-import com.google.gwt.requestfactory.shared.UserInformationRecord;
+import com.google.gwt.requestfactory.shared.UserInformationProxy;
import com.google.gwt.requestfactory.shared.Value;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
@@ -103,8 +103,8 @@
requestFactory.init(eventBus);
requestFactory.employeeRequest().findEmployee(Value.of(employeeId)).fire(
- new Receiver<EmployeeRecord>() {
- public void onSuccess(EmployeeRecord employee,
+ new Receiver<EmployeeProxy>() {
+ public void onSuccess(EmployeeProxy employee,
Set<SyncResult> syncResults) {
final ExpensesMobileShell shell = new ExpensesMobileShell(eventBus,
requestFactory, employee);
@@ -116,9 +116,9 @@
// Add a login widget to the page
final LoginWidget login = shell.getLoginWidget();
- Receiver<UserInformationRecord> receiver
- = new Receiver<UserInformationRecord>() {
- public void onSuccess(UserInformationRecord userInformationRecord,
+ Receiver<UserInformationProxy> receiver
+ = new Receiver<UserInformationProxy>() {
+ public void onSuccess(UserInformationProxy userInformationRecord,
Set<SyncResult> syncResults) {
login.setUserInformation(userInformationRecord);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java
index 1845f02..917a320 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java
@@ -20,10 +20,10 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.requestfactory.client.LoginWidget;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
@@ -53,13 +53,13 @@
private MobileExpenseEntry expenseEntry;
private MobileReportEntry reportEntry;
- private final EmployeeRecord employee;
+ private final EmployeeProxy employee;
private final HandlerManager eventBus;
private final ExpensesRequestFactory requestFactory;
private ArrayList<MobilePage> pages = new ArrayList<MobilePage>();
public ExpensesMobileShell(HandlerManager eventBus,
- ExpensesRequestFactory requestFactory, EmployeeRecord employee) {
+ ExpensesRequestFactory requestFactory, EmployeeProxy employee) {
this.eventBus = eventBus;
this.requestFactory = requestFactory;
this.employee = employee;
@@ -112,11 +112,11 @@
showPage(page);
}
- private void showExpenseDetails(ExpenseRecord expense) {
+ private void showExpenseDetails(ExpenseProxy expense) {
if (expenseDetails == null) {
expenseDetails = new MobileExpenseDetails(
new MobileExpenseDetails.Listener() {
- public void onEditExpense(ExpenseRecord expense) {
+ public void onEditExpense(ExpenseProxy expense) {
showExpenseEntry(expense);
}
}, eventBus, requestFactory);
@@ -126,7 +126,7 @@
pushPage(expenseDetails);
}
- private void showExpenseEntry(ExpenseRecord expense) {
+ private void showExpenseEntry(ExpenseProxy expense) {
if (expenseEntry == null) {
expenseEntry = new MobileExpenseEntry(new MobileExpenseEntry.Listener() {
public void onExpenseUpdated() {
@@ -139,7 +139,7 @@
pushPage(expenseEntry);
}
- private void showReportEntry(ReportRecord report) {
+ private void showReportEntry(ReportProxy report) {
if (reportEntry == null) {
reportEntry = new MobileReportEntry(new MobileReportEntry.Listener() {
public void onReportUpdated() {
@@ -152,18 +152,18 @@
pushPage(reportEntry);
}
- private void showExpenseList(final ReportRecord report) {
+ private void showExpenseList(final ReportProxy report) {
if (expenseList == null) {
expenseList = new MobileExpenseList(new MobileExpenseList.Listener() {
- public void onCreateExpense(ReportRecord report) {
+ public void onCreateExpense(ReportProxy report) {
showNewExpenseEntry(report);
}
- public void onEditReport(ReportRecord report) {
+ public void onEditReport(ReportProxy report) {
showReportEntry(report);
}
- public void onExpenseSelected(ExpenseRecord expense) {
+ public void onExpenseSelected(ExpenseProxy expense) {
showExpenseDetails(expense);
}
}, requestFactory);
@@ -173,7 +173,7 @@
pushPage(expenseList);
}
- private void showNewExpenseEntry(ReportRecord report) {
+ private void showNewExpenseEntry(ReportProxy report) {
if (expenseEntry == null) {
expenseEntry = new MobileExpenseEntry(new MobileExpenseEntry.Listener() {
public void onExpenseUpdated() {
@@ -186,7 +186,7 @@
pushPage(expenseEntry);
}
- private void showNewReportEntry(EmployeeRecord reporter) {
+ private void showNewReportEntry(EmployeeProxy reporter) {
if (reportEntry == null) {
reportEntry = new MobileReportEntry(new MobileReportEntry.Listener() {
public void onReportUpdated() {
@@ -224,11 +224,11 @@
private void showReportList() {
if (reportList == null) {
reportList = new MobileReportList(new MobileReportList.Listener() {
- public void onCreateReport(EmployeeRecord reporter) {
+ public void onCreateReport(EmployeeProxy reporter) {
showNewReportEntry(reporter);
}
- public void onReportSelected(ReportRecord report) {
+ public void onReportSelected(ReportProxy report) {
showExpenseList(report);
}
}, requestFactory, employee);
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseDetails.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseDetails.java
index d3464cd..baabc59 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseDetails.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseDetails.java
@@ -23,8 +23,8 @@
import com.google.gwt.requestfactory.shared.PropertyReference;
import com.google.gwt.requestfactory.shared.Receiver;
import com.google.gwt.requestfactory.shared.SyncResult;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecord;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecordChanged;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxy;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxyChanged;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
@@ -43,7 +43,7 @@
* TODO: doc.
*/
public interface Listener {
- void onEditExpense(ExpenseRecord expense);
+ void onEditExpense(ExpenseProxy expense);
}
interface Binder extends UiBinder<Widget, MobileExpenseDetails> {
@@ -55,7 +55,7 @@
Element approvalText, nameText, dateText, categoryText, priceText, reasonRow,
reasonText;
- private ExpenseRecord expense;
+ private ExpenseProxy expense;
private final Listener listener;
private final ExpensesRequestFactory requestFactory;
@@ -64,11 +64,11 @@
this.listener = listener;
this.requestFactory = requestFactory;
- eventBus.addHandler(ExpenseRecordChanged.TYPE,
- new ExpenseRecordChanged.Handler() {
- public void onExpenseRecordChanged(ExpenseRecordChanged event) {
+ eventBus.addHandler(ExpenseProxyChanged.TYPE,
+ new ExpenseProxyChanged.Handler() {
+ public void onExpenseRecordChanged(ExpenseProxyChanged event) {
if (expense != null) {
- ExpenseRecord newRecord = event.getRecord();
+ ExpenseProxy newRecord = event.getProxy();
if (newRecord.getId().equals(expense.getId())) {
show(newRecord);
}
@@ -108,18 +108,18 @@
public void onRefresh(boolean clear) {
PropertyReference<Long> idRef = new PropertyReference<Long>(expense,
- ExpenseRecord.id);
+ ExpenseProxy.id);
requestFactory.expenseRequest().findExpense(idRef).fire(
- new Receiver<List<ExpenseRecord>>() {
- public void onSuccess(List<ExpenseRecord> response, Set<SyncResult> syncResults) {
+ new Receiver<List<ExpenseProxy>>() {
+ public void onSuccess(List<ExpenseProxy> response, Set<SyncResult> syncResults) {
assert response.size() == 1;
show(response.get(0));
}
});
}
- public void show(ExpenseRecord expense) {
+ public void show(ExpenseProxy expense) {
this.expense = expense;
@SuppressWarnings("deprecation")
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java
index e887483..9b69f49 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java
@@ -20,9 +20,9 @@
import com.google.gwt.requestfactory.shared.Receiver;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.SyncResult;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecord;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
@@ -53,7 +53,7 @@
@UiField ListBox dateYear, dateMonth, dateDay;
@UiField Element errorText;
- private ExpenseRecord expense;
+ private ExpenseProxy expense;
private final ExpensesRequestFactory requestFactory;
private final Listener listener;
private RequestObject<Void> requestObject;
@@ -73,10 +73,10 @@
return this;
}
- public void create(ReportRecord report) {
- expense = requestFactory.create(ExpenseRecord.class);
+ public void create(ReportProxy report) {
+ expense = requestFactory.create(ExpenseProxy.class);
requestObject = requestFactory.expenseRequest().persist(expense);
- ExpenseRecord editableExpense = requestObject.edit(expense);
+ ExpenseProxy editableExpense = requestObject.edit(expense);
editableExpense.setReport(report);
displayExpense();
}
@@ -102,7 +102,7 @@
@SuppressWarnings("deprecation")
public void onCustom() {
- ExpenseRecord editableExpense = requestObject.edit(expense);
+ ExpenseProxy editableExpense = requestObject.edit(expense);
editableExpense.setDescription(nameText.getText());
editableExpense.setCategory(categoryText.getText());
@@ -144,7 +144,7 @@
public void onRefresh(boolean clear) {
}
- public void show(ExpenseRecord expense) {
+ public void show(ExpenseProxy expense) {
this.expense = expense;
displayExpense();
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseList.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseList.java
index 8169395..d2413f8 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseList.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseList.java
@@ -22,9 +22,9 @@
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
-import com.google.gwt.sample.expenses.client.request.ExpenseRecord;
+import com.google.gwt.sample.expenses.client.request.ExpenseProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Composite;
@@ -59,17 +59,17 @@
* TODO: doc.
*/
public interface Listener {
- void onCreateExpense(ReportRecord report);
+ void onCreateExpense(ReportProxy report);
- void onEditReport(ReportRecord report);
+ void onEditReport(ReportProxy report);
- void onExpenseSelected(ExpenseRecord expense);
+ void onExpenseSelected(ExpenseProxy expense);
}
/**
- * The cell used to render {@link ExpenseRecord}s.
+ * The cell used to render {@link ExpenseProxy}s.
*/
- private class ExpenseCell extends AbstractCell<ExpenseRecord> {
+ private class ExpenseCell extends AbstractCell<ExpenseProxy> {
private final SafeHtml approvedHtml;
private final String approvedText = Expenses.Approval.APPROVED.getText();
@@ -87,7 +87,7 @@
}
@Override
- public void render(ExpenseRecord value, Object viewData, SafeHtmlBuilder sb) {
+ public void render(ExpenseProxy value, Object viewData, SafeHtmlBuilder sb) {
String approval = value.getApproval();
SafeHtml approvalIcon;
if (approvedText.equals(approval)) {
@@ -103,9 +103,9 @@
}
private final ExpensesRequestFactory requestFactory;
- private final CellList<ExpenseRecord> expenseList;
- private final AsyncDataProvider<ExpenseRecord> expenseDataProvider;
- private final NoSelectionModel<ExpenseRecord> expenseSelection;
+ private final CellList<ExpenseProxy> expenseList;
+ private final AsyncDataProvider<ExpenseProxy> expenseDataProvider;
+ private final NoSelectionModel<ExpenseProxy> expenseSelection;
/**
* The set of Expense keys that we already know are denied. When a new key is
@@ -116,9 +116,9 @@
/**
* The receiver for the last request.
*/
- private Receiver<List<ExpenseRecord>> lastReceiver;
+ private Receiver<List<ExpenseProxy>> lastReceiver;
- private ReportRecord report;
+ private ReportProxy report;
private final Listener listener;
/**
@@ -135,17 +135,17 @@
final Listener listener, final ExpensesRequestFactory requestFactory) {
this.listener = listener;
this.requestFactory = requestFactory;
- expenseDataProvider = new AsyncDataProvider<ExpenseRecord>() {
+ expenseDataProvider = new AsyncDataProvider<ExpenseProxy>() {
@Override
- protected void onRangeChanged(HasData<ExpenseRecord> view) {
+ protected void onRangeChanged(HasData<ExpenseProxy> view) {
requestExpenses();
}
};
expenseDataProvider.setKeyProvider(Expenses.EXPENSE_RECORD_KEY_PROVIDER);
- expenseList = new CellList<ExpenseRecord>(new ExpenseCell());
+ expenseList = new CellList<ExpenseProxy>(new ExpenseCell());
- expenseSelection = new NoSelectionModel<ExpenseRecord>();
+ expenseSelection = new NoSelectionModel<ExpenseProxy>();
expenseList.setSelectionModel(expenseSelection);
expenseSelection.addSelectionChangeHandler(
new SelectionChangeEvent.Handler() {
@@ -194,7 +194,7 @@
requestExpenses();
}
- public void show(ReportRecord report) {
+ public void show(ReportProxy report) {
this.report = report;
knownDeniedKeys = null;
@@ -203,7 +203,7 @@
private String[] getExpenseColumns() {
return new String[]{
- ExpenseRecord.description.getName(), ExpenseRecord.amount.getName()};
+ ExpenseProxy.description.getName(), ExpenseProxy.amount.getName()};
}
/**
@@ -214,9 +214,9 @@
if (requestFactory == null || report == null) {
return;
}
- lastReceiver = new Receiver<List<ExpenseRecord>>() {
+ lastReceiver = new Receiver<List<ExpenseProxy>>() {
public void onSuccess(
- List<ExpenseRecord> newValues, Set<SyncResult> syncResults) {
+ List<ExpenseProxy> newValues, Set<SyncResult> syncResults) {
if (this == lastReceiver) {
int size = newValues.size();
expenseDataProvider.updateRowCount(size, true);
@@ -227,12 +227,12 @@
if (knownDeniedKeys == null) {
knownDeniedKeys = new HashSet<Object>();
}
- for (ExpenseRecord value : newValues) {
+ for (ExpenseProxy value : newValues) {
Object key = expenseDataProvider.getKey(value);
String approval = value.getApproval();
if (Expenses.Approval.DENIED.getText().equals(approval)) {
if (!isInitialData && !knownDeniedKeys.contains(key)) {
- (new PhaseAnimation.CellListPhaseAnimation<ExpenseRecord>(
+ (new PhaseAnimation.CellListPhaseAnimation<ExpenseProxy>(
expenseList, value, expenseDataProvider)).run();
}
knownDeniedKeys.add(key);
@@ -246,7 +246,7 @@
}
};
requestFactory.expenseRequest().findExpensesByReport(
- report.getRef(ReportRecord.id)).with(getExpenseColumns()).fire(
+ report.getRef(ReportProxy.id)).with(getExpenseColumns()).fire(
lastReceiver);
}
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java
index 9e4ba3f..34d8a1d 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java
@@ -20,9 +20,9 @@
import com.google.gwt.requestfactory.shared.Receiver;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.SyncResult;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
@@ -58,7 +58,7 @@
@UiField
Element errorText;
- private ReportRecord report;
+ private ReportProxy report;
private final ExpensesRequestFactory requestFactory;
private final Listener listener;
private RequestObject<Void> requestObject;
@@ -82,10 +82,10 @@
return this;
}
- public void create(EmployeeRecord reporter) {
- report = requestFactory.create(ReportRecord.class);
+ public void create(EmployeeProxy reporter) {
+ report = requestFactory.create(ReportProxy.class);
requestObject = requestFactory.reportRequest().persist(report);
- ReportRecord editableReport = requestObject.edit(report);
+ ReportProxy editableReport = requestObject.edit(report);
editableReport.setReporter(reporter);
displayReport();
}
@@ -111,7 +111,7 @@
@SuppressWarnings("deprecation")
public void onCustom() {
- ReportRecord editableReport = requestObject.edit(report);
+ ReportProxy editableReport = requestObject.edit(report);
editableReport.setPurpose(purposeText.getText());
editableReport.setNotes(notesText.getText());
editableReport.setDepartment(departmentList.getValue(departmentList.getSelectedIndex()));
@@ -146,7 +146,7 @@
public void onRefresh(boolean clear) {
}
- public void show(ReportRecord report) {
+ public void show(ReportProxy report) {
this.report = report;
displayReport();
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportList.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportList.java
index e9817f1..bb75159 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportList.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportList.java
@@ -19,9 +19,9 @@
import com.google.gwt.requestfactory.shared.Receiver;
import com.google.gwt.requestfactory.shared.SyncResult;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.sample.expenses.client.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
@@ -42,48 +42,48 @@
* TODO: doc.
*/
public interface Listener {
- void onCreateReport(EmployeeRecord reporter);
+ void onCreateReport(EmployeeProxy reporter);
- void onReportSelected(ReportRecord report);
+ void onReportSelected(ReportProxy report);
}
/**
* The receiver for the last request.
*/
- private Receiver<List<ReportRecord>> lastReceiver;
+ private Receiver<List<ReportProxy>> lastReceiver;
- private final EmployeeRecord employee;
+ private final EmployeeProxy employee;
private final Listener listener;
- private final CellList<ReportRecord> reportList;
- private final AsyncDataProvider<ReportRecord> reportDataProvider;
- private final NoSelectionModel<ReportRecord> reportSelection;
+ private final CellList<ReportProxy> reportList;
+ private final AsyncDataProvider<ReportProxy> reportDataProvider;
+ private final NoSelectionModel<ReportProxy> reportSelection;
private final ExpensesRequestFactory requestFactory;
public MobileReportList(final Listener listener,
- final ExpensesRequestFactory requestFactory, EmployeeRecord employee) {
+ final ExpensesRequestFactory requestFactory, EmployeeProxy employee) {
this.listener = listener;
this.requestFactory = requestFactory;
this.employee = employee;
- reportDataProvider = new AsyncDataProvider<ReportRecord>() {
+ reportDataProvider = new AsyncDataProvider<ReportProxy>() {
@Override
- protected void onRangeChanged(HasData<ReportRecord> view) {
+ protected void onRangeChanged(HasData<ReportProxy> view) {
requestReports();
}
};
reportDataProvider.setKeyProvider(Expenses.REPORT_RECORD_KEY_PROVIDER);
- reportList = new CellList<ReportRecord>(new AbstractCell<ReportRecord>() {
+ reportList = new CellList<ReportProxy>(new AbstractCell<ReportProxy>() {
@Override
public void render(
- ReportRecord value, Object viewData, SafeHtmlBuilder sb) {
+ ReportProxy value, Object viewData, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<div class='item'>");
sb.appendEscaped(value.getPurpose());
sb.appendHtmlConstant("</div>");
}
});
- reportSelection = new NoSelectionModel<ReportRecord>();
+ reportSelection = new NoSelectionModel<ReportProxy>();
reportSelection.setKeyProvider(Expenses.REPORT_RECORD_KEY_PROVIDER);
reportSelection.addSelectionChangeHandler(
new SelectionChangeEvent.Handler() {
@@ -135,23 +135,23 @@
private String[] getReportColumns() {
return new String[]{
- ReportRecord.created.getName(), ReportRecord.purpose.getName()};
+ ReportProxy.created.getName(), ReportProxy.purpose.getName()};
}
private void requestReports() {
if (requestFactory == null) {
return;
}
- lastReceiver = new Receiver<List<ReportRecord>>() {
+ lastReceiver = new Receiver<List<ReportProxy>>() {
public void onSuccess(
- List<ReportRecord> newValues, Set<SyncResult> syncResults) {
+ List<ReportProxy> newValues, Set<SyncResult> syncResults) {
int size = newValues.size();
reportDataProvider.updateRowCount(size, true);
reportDataProvider.updateRowData(0, newValues);
}
};
requestFactory.reportRequest().findReportEntriesBySearch(employee.getId(),
- "", "", ReportRecord.created.getName() + " DESC", 0, 25).with(
+ "", "", ReportProxy.created.getName() + " DESC", 0, 25).with(
getReportColumns()).fire(lastReceiver);
}
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecord.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxy.java
similarity index 77%
rename from samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecord.java
rename to samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxy.java
index 1888711..ae6a8b2 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecord.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxy.java
@@ -15,9 +15,9 @@
*/
package com.google.gwt.sample.expenses.client.request;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
/**
* "API Generated" DTO interface based on
@@ -25,15 +25,15 @@
* <p>
* IRL this class will be generated by a JPA-savvy tool run before compilation.
*/
-@DataTransferObject(com.google.gwt.sample.expenses.server.domain.Employee.class)
-public interface EmployeeRecord extends Record {
+@ProxyFor(com.google.gwt.sample.expenses.server.domain.Employee.class)
+public interface EmployeeProxy extends EntityProxy {
Property<String> userName = new Property<String>("userName", "User Name", String.class);
Property<String> displayName = new Property<String>("displayName", "Display Name",
String.class);
Property<String> password = new Property<String>("password", "Password", String.class);
- Property<EmployeeRecord> supervisor = new Property<EmployeeRecord>("supervisor", "Supervisor",
- EmployeeRecord.class);
+ Property<EmployeeProxy> supervisor = new Property<EmployeeProxy>("supervisor", "Supervisor",
+ EmployeeProxy.class);
Property<String> department = new Property<String>("department", "Department", String.class);
@@ -43,7 +43,7 @@
String getPassword();
- EmployeeRecord getSupervisor();
+ EmployeeProxy getSupervisor();
String getUserName();
@@ -55,7 +55,7 @@
void setPassword(String password);
- void setSupervisor(EmployeeRecord supervisor);
+ void setSupervisor(EmployeeProxy supervisor);
void setUserName(String userName);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecordChanged.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxyChanged.java
similarity index 78%
rename from samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecordChanged.java
rename to samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxyChanged.java
index 6adea30..ec5ec12 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRecordChanged.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeProxyChanged.java
@@ -17,29 +17,28 @@
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.GwtEvent.Type;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
/**
- * "API Generated" event posted when the values of a {@link EmployeeRecord}
+ * "API Generated" event posted when the values of a {@link EmployeeProxy}
* change.
* <p>
* IRL this class will be generated by a JPA-savvy tool run before compilation.
*/
-public class EmployeeRecordChanged extends
- RecordChangedEvent<EmployeeRecord, EmployeeRecordChanged.Handler> {
+public class EmployeeProxyChanged extends
+ EntityProxyChangedEvent<EmployeeProxy, EmployeeProxyChanged.Handler> {
/**
* Implemented by handlers of this type of event.
*/
public interface Handler extends EventHandler {
- void onEmployeeChanged(EmployeeRecordChanged event);
+ void onEmployeeChanged(EmployeeProxyChanged event);
}
public static final Type<Handler> TYPE = new Type<Handler>();
- public EmployeeRecordChanged(EmployeeRecord record, WriteOperation writeOperation) {
+ public EmployeeProxyChanged(EmployeeProxy record, WriteOperation writeOperation) {
super(record, writeOperation);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRequest.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRequest.java
index d925d4d..4cf1f9e 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRequest.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/EmployeeRequest.java
@@ -17,8 +17,8 @@
import com.google.gwt.requestfactory.shared.Instance;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.Service;
import com.google.gwt.sample.expenses.server.domain.Employee;
@@ -47,34 +47,34 @@
/**
* @return a request object
*/
- RecordListRequest<EmployeeRecord> findAllEmployees();
+ ProxyListRequest<EmployeeProxy> findAllEmployees();
/**
* @return a request object
*/
- RecordRequest<EmployeeRecord> findEmployee(PropertyReference<Long> id);
+ ProxyRequest<EmployeeProxy> findEmployee(PropertyReference<Long> id);
/**
* @return a request object
*/
- RecordListRequest<EmployeeRecord> findEmployeeEntries(int firstResult,
+ ProxyListRequest<EmployeeProxy> findEmployeeEntries(int firstResult,
int maxResults);
/**
* @return a request object
*/
- RecordListRequest<EmployeeRecord> findEmployeeEntriesByDepartment(
+ ProxyListRequest<EmployeeProxy> findEmployeeEntriesByDepartment(
String department, int firstResult, int maxResults);
/**
* @return a request object
*/
@Instance
- RequestObject<Void> persist(EmployeeRecord record);
+ RequestObject<Void> persist(EmployeeProxy record);
/**
* @return a request object
*/
@Instance
- RequestObject<Void> remove(EmployeeRecord record);
+ RequestObject<Void> remove(EmployeeProxy record);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecord.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxy.java
similarity index 81%
rename from samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecord.java
rename to samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxy.java
index e01cd09..e2b09c0 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecord.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxy.java
@@ -15,9 +15,9 @@
*/
package com.google.gwt.sample.expenses.client.request;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import java.util.Date;
@@ -27,8 +27,8 @@
* <p>
* IRL this class will be generated by a JPA-savvy tool run before compilation.
*/
-@DataTransferObject(com.google.gwt.sample.expenses.server.domain.Expense.class)
-public interface ExpenseRecord extends Record {
+@ProxyFor(com.google.gwt.sample.expenses.server.domain.Expense.class)
+public interface ExpenseProxy extends EntityProxy {
Property<Double> amount = new Property<Double>("amount", "Amount", Double.class);
Property<String> approval = new Property<String>("approval", "Approval", String.class);
@@ -36,7 +36,7 @@
Property<Date> created = new Property<Date>("created", "Created", Date.class);
Property<String> description = new Property<String>("description", "Description", String.class);
Property<String> reasonDenied = new Property<String>("reasonDenied", "Reason Denied", String.class);
- Property<ReportRecord> report = new Property<ReportRecord>("report", "Report", ReportRecord.class);
+ Property<ReportProxy> report = new Property<ReportProxy>("report", "Report", ReportProxy.class);
Double getAmount();
@@ -50,7 +50,7 @@
String getReasonDenied();
- ReportRecord getReport();
+ ReportProxy getReport();
boolean isChanged();
@@ -66,5 +66,5 @@
void setReasonDenied(String reasonDenied);
- void setReport(ReportRecord report);
+ void setReport(ReportProxy report);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecordChanged.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxyChanged.java
similarity index 78%
rename from samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecordChanged.java
rename to samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxyChanged.java
index 5dcb4ff..f3c7211 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRecordChanged.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseProxyChanged.java
@@ -17,29 +17,28 @@
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.GwtEvent.Type;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
/**
- * "API Generated" event posted when the values of an {@link ExpenseRecord}
+ * "API Generated" event posted when the values of an {@link ExpenseProxy}
* change.
* <p>
* IRL this class will be generated by a JPA-savvy tool run before compilation.
*/
-public class ExpenseRecordChanged extends
- RecordChangedEvent<ExpenseRecord, ExpenseRecordChanged.Handler> {
+public class ExpenseProxyChanged extends
+ EntityProxyChangedEvent<ExpenseProxy, ExpenseProxyChanged.Handler> {
/**
* Implemented by handlers of this type of event.
*/
public interface Handler extends EventHandler {
- void onExpenseRecordChanged(ExpenseRecordChanged event);
+ void onExpenseRecordChanged(ExpenseProxyChanged event);
}
public static final Type<Handler> TYPE = new Type<Handler>();
- public ExpenseRecordChanged(ExpenseRecord record, WriteOperation writeOperation) {
+ public ExpenseProxyChanged(ExpenseProxy record, WriteOperation writeOperation) {
super(record, writeOperation);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRequest.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRequest.java
index 3161fa1..ed9fd51 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRequest.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpenseRequest.java
@@ -17,7 +17,7 @@
import com.google.gwt.requestfactory.shared.Instance;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.Service;
import com.google.gwt.sample.expenses.server.domain.Expense;
@@ -35,30 +35,30 @@
/**
* @return a request object
*/
- RecordListRequest<ExpenseRecord> findAllExpenses();
+ ProxyListRequest<ExpenseProxy> findAllExpenses();
/**
* @return a request object
*/
- RecordListRequest<ExpenseRecord> findExpense(
+ ProxyListRequest<ExpenseProxy> findExpense(
PropertyReference<Long> id);
/**
* @return a request object
*/
- RecordListRequest<ExpenseRecord> findExpensesByReport(
+ ProxyListRequest<ExpenseProxy> findExpensesByReport(
PropertyReference<Long> reportId);
/**
* @return a request object
*/
@Instance
- RequestObject<Void> persist(ExpenseRecord record);
+ RequestObject<Void> persist(ExpenseProxy record);
/**
* @return a request object
*/
@Instance
- RequestObject<Void> remove(ExpenseRecord record);
+ RequestObject<Void> remove(ExpenseProxy record);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpensesEntityTypesProcessor.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpensesEntityTypesProcessor.java
index 0139801..081bb60 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpensesEntityTypesProcessor.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ExpensesEntityTypesProcessor.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.sample.expenses.client.request;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import java.util.Collections;
import java.util.HashSet;
@@ -42,23 +42,23 @@
/**
* Return a set of all proxy types available to this application.
*/
- public static Set<Class<? extends Record>> getAll() {
- Set<Class<? extends Record>> rtn = new HashSet<Class<? extends Record>>();
+ public static Set<Class<? extends EntityProxy>> getAll() {
+ Set<Class<? extends EntityProxy>> rtn = new HashSet<Class<? extends EntityProxy>>();
- rtn.add(EmployeeRecord.class);
- rtn.add(ReportRecord.class);
+ rtn.add(EmployeeProxy.class);
+ rtn.add(ReportProxy.class);
return Collections.unmodifiableSet(rtn);
}
private static void process(ExpensesEntityTypesProcessor<?> processor,
Class<?> clazz) {
- if (EmployeeRecord.class.equals(clazz)) {
- processor.handleEmployee((EmployeeRecord) null);
+ if (EmployeeProxy.class.equals(clazz)) {
+ processor.handleEmployee((EmployeeProxy) null);
return;
}
- if (ReportRecord.class.equals(clazz)) {
- processor.handleReport((ReportRecord) null);
+ if (ReportProxy.class.equals(clazz)) {
+ processor.handleReport((ReportProxy) null);
return;
}
processor.handleNonProxy(null);
@@ -66,12 +66,12 @@
private static void process(ExpensesEntityTypesProcessor<?> processor,
Object proxy) {
- if (proxy instanceof EmployeeRecord) {
- processor.handleEmployee((EmployeeRecord) proxy);
+ if (proxy instanceof EmployeeProxy) {
+ processor.handleEmployee((EmployeeProxy) proxy);
return;
}
- if (proxy instanceof ReportRecord) {
- processor.handleReport((ReportRecord) proxy);
+ if (proxy instanceof ReportProxy) {
+ processor.handleReport((ReportProxy) proxy);
return;
}
processor.handleNonProxy(proxy);
@@ -98,7 +98,7 @@
this.defaultValue = defaultValue;
}
- public abstract void handleEmployee(EmployeeRecord proxy);
+ public abstract void handleEmployee(EmployeeProxy proxy);
/**
* Called if {@link #process} is called with a non-proxy object. This default
@@ -107,7 +107,7 @@
public void handleNonProxy(@SuppressWarnings("unused") Object object) {
}
- public abstract void handleReport(ReportRecord proxy);
+ public abstract void handleReport(ReportProxy proxy);
/**
* Call the handle method of the appropriate type, with a null argument. Note
@@ -115,7 +115,7 @@
* {@link #getClass()} method of a proxy object, due to limitations of GWT's
* metadata. It will only work with against class objects in the set returned
* by {@link #getAll()}, or returned by
- * {@link com.google.gwt.requestfactory.shared.RequestFactory#getClass(Record)}
+ * {@link com.google.gwt.requestfactory.shared.RequestFactory#getClass(EntityProxy)}
* or
* {@link com.google.gwt.requestfactory.shared.RequestFactory#getClass(String)}
* .
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecord.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxy.java
similarity index 68%
rename from samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecord.java
rename to samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxy.java
index 7e2ca04..4b59199 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecord.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxy.java
@@ -15,9 +15,9 @@
*/
package com.google.gwt.sample.expenses.client.request;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import java.util.Date;
@@ -27,19 +27,19 @@
* <p>
* IRL this class will be generated by a JPA-savvy tool run before compilation.
*/
-@DataTransferObject(com.google.gwt.sample.expenses.server.domain.Report.class)
-public interface ReportRecord extends Record {
+@ProxyFor(com.google.gwt.sample.expenses.server.domain.Report.class)
+public interface ReportProxy extends EntityProxy {
- Property<EmployeeRecord> approvedSupervisor = new Property<EmployeeRecord>("approvedSupervisor", "Approved Supervisor Key",
- EmployeeRecord.class);
+ Property<EmployeeProxy> approvedSupervisor = new Property<EmployeeProxy>("approvedSupervisor", "Approved Supervisor Key",
+ EmployeeProxy.class);
Property<Date> created = new Property<Date>("created", "Created", Date.class);
Property<String> department = new Property<String>("department", "Department", String.class);
Property<String> notes = new Property<String>("notes", "Notes", String.class);
Property<String> purpose = new Property<String>("purpose", "Purpose", String.class);
- Property<EmployeeRecord> reporter = new Property<EmployeeRecord>("reporter", "Reporter",
- EmployeeRecord.class);
+ Property<EmployeeProxy> reporter = new Property<EmployeeProxy>("reporter", "Reporter",
+ EmployeeProxy.class);
- EmployeeRecord getApprovedSupervisor();
+ EmployeeProxy getApprovedSupervisor();
Date getCreated();
@@ -49,11 +49,11 @@
String getPurpose();
- EmployeeRecord getReporter();
+ EmployeeProxy getReporter();
boolean isChanged();
- void setApprovedSupervisor(EmployeeRecord approvedSupervisor);
+ void setApprovedSupervisor(EmployeeProxy approvedSupervisor);
void setCreated(Date created);
@@ -63,5 +63,5 @@
void setPurpose(String purpose);
- void setReporter(EmployeeRecord reporter);
+ void setReporter(EmployeeProxy reporter);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecordChanged.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxyChanged.java
similarity index 80%
rename from samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecordChanged.java
rename to samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxyChanged.java
index 9da88f8..ebdc255 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRecordChanged.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportProxyChanged.java
@@ -17,28 +17,28 @@
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
/**
- * "API Generated" event posted when the values of a {@link EmployeeRecord}
+ * "API Generated" event posted when the values of a {@link EmployeeProxy}
* change.
* <p>
* IRL this class will be generated by a JPA-savvy tool run before compilation.
*/
-public class ReportRecordChanged extends
- RecordChangedEvent<ReportRecord, ReportRecordChanged.Handler> {
+public class ReportProxyChanged extends
+ EntityProxyChangedEvent<ReportProxy, ReportProxyChanged.Handler> {
/**
* Implemented by handlers of this type of event.
*/
public interface Handler extends EventHandler {
- void onReportChanged(ReportRecordChanged event);
+ void onReportChanged(ReportProxyChanged event);
}
public static final Type<Handler> TYPE = new Type<Handler>();
- public ReportRecordChanged(ReportRecord record, WriteOperation writeOperation) {
+ public ReportProxyChanged(ReportProxy record, WriteOperation writeOperation) {
super(record, writeOperation);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRequest.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRequest.java
index f8b4805..ecae945 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRequest.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/request/ReportRequest.java
@@ -17,8 +17,8 @@
import com.google.gwt.requestfactory.shared.Instance;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.Service;
import com.google.gwt.sample.expenses.server.domain.Report;
@@ -47,41 +47,41 @@
/**
* @return a request object
*/
- RecordListRequest<ReportRecord> findAllReports();
+ ProxyListRequest<ReportProxy> findAllReports();
/**
* @return a request object
*/
- RecordRequest<ReportRecord> findReport(PropertyReference<Long> id);
+ ProxyRequest<ReportProxy> findReport(PropertyReference<Long> id);
/**
* @return a request object
*/
- RecordListRequest<ReportRecord> findReportEntries(int firstResult,
+ ProxyListRequest<ReportProxy> findReportEntries(int firstResult,
int maxResults);
/**
* @return a request object
*/
- RecordListRequest<ReportRecord> findReportEntriesBySearch(Long employeeId,
+ ProxyListRequest<ReportProxy> findReportEntriesBySearch(Long employeeId,
String department, String startsWith, String orderBy, int firstResult,
int maxResults);
/**
* @return a request object
*/
- RecordListRequest<ReportRecord> findReportsByEmployee(
+ ProxyListRequest<ReportProxy> findReportsByEmployee(
PropertyReference<String> id);
/**
* @return a request object
*/
@Instance
- RequestObject<Void> persist(ReportRecord record);
+ RequestObject<Void> persist(ReportProxy record);
/**
* @return a request object
*/
@Instance
- RequestObject<Void> remove(ReportRecord record);
+ RequestObject<Void> remove(ReportProxy record);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeDetailsView.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeDetailsView.java
index e73dda5..9c76f33 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeDetailsView.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeDetailsView.java
@@ -15,12 +15,12 @@
*/
package com.google.gwt.sample.expenses.client.ui.employee;
-import com.google.gwt.app.place.RecordDetailsView;
+import com.google.gwt.app.place.ProxyDetailsView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
@@ -33,13 +33,13 @@
* Details view for employee records.
*/
public class EmployeeDetailsView extends Composite implements
- RecordDetailsView<EmployeeRecord> {
+ ProxyDetailsView<EmployeeProxy> {
interface Binder extends UiBinder<HTMLPanel, EmployeeDetailsView> {
}
private static final Binder BINDER = GWT.create(Binder.class);
- EmployeeRecord record;
+ EmployeeProxy record;
@UiField
SpanElement idSpan;
@@ -72,7 +72,7 @@
return Window.confirm(msg);
}
- public EmployeeRecord getValue() {
+ public EmployeeProxy getValue() {
return record;
}
@@ -90,7 +90,7 @@
this.delegate = delegate;
}
- public void setValue(EmployeeRecord record) {
+ public void setValue(EmployeeProxy record) {
this.record = record;
displayName.setInnerText(record.getDisplayName());
userName.setInnerText(record.getUserName());
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeEditView.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeEditView.java
index 16a2688..831c2e1 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeEditView.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeEditView.java
@@ -16,13 +16,13 @@
package com.google.gwt.sample.expenses.client.ui.employee;
import com.google.gwt.app.client.EditorSupport;
-import com.google.gwt.app.place.RecordEditView;
+import com.google.gwt.app.place.ProxyEditView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
@@ -40,11 +40,11 @@
* Edit view for employee records.
*/
public class EmployeeEditView extends Composite implements
- RecordEditView<EmployeeRecord> {
+ ProxyEditView<EmployeeProxy> {
interface Binder extends UiBinder<HTMLPanel, EmployeeEditView> {
}
- interface DataBinder extends EditorSupport<EmployeeRecord, EmployeeEditView> {
+ interface DataBinder extends EditorSupport<EmployeeProxy, EmployeeEditView> {
}
private static final Binder BINDER = GWT.create(Binder.class);
@@ -55,7 +55,7 @@
@UiField
TextBox password;
@UiField(provided = true)
- ValueListBox<EmployeeRecord> supervisor = new ValueListBox<EmployeeRecord>(
+ ValueListBox<EmployeeProxy> supervisor = new ValueListBox<EmployeeProxy>(
EmployeeRenderer.instance());
@UiField
@@ -77,7 +77,7 @@
Element createTitle;
private Delegate delegate;
- private EmployeeRecord record;
+ private EmployeeProxy record;
public EmployeeEditView() {
initWidget(BINDER.createAndBindUi(this));
@@ -92,7 +92,7 @@
return DATA_BINDER.getPaths();
}
- public EmployeeRecord getValue() {
+ public EmployeeProxy getValue() {
return record;
}
@@ -114,7 +114,7 @@
this.delegate = delegate;
}
- public void setEmployeePickerValues(Collection<EmployeeRecord> values) {
+ public void setEmployeePickerValues(Collection<EmployeeProxy> values) {
supervisor.setAcceptableValues(values);
}
@@ -123,7 +123,7 @@
save.setEnabled(enabled);
}
- public void setValue(EmployeeRecord value) {
+ public void setValue(EmployeeProxy value) {
this.record = value;
DATA_BINDER.setValue(this, value);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeListView.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeListView.java
index b94784b..0510ca5 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeListView.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeListView.java
@@ -15,10 +15,10 @@
*/
package com.google.gwt.sample.expenses.client.ui.employee;
-import com.google.gwt.app.place.AbstractRecordListView;
+import com.google.gwt.app.place.AbstractProxyListView;
import com.google.gwt.app.place.PropertyColumn;
import com.google.gwt.core.client.GWT;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.cellview.client.CellTable;
@@ -29,34 +29,34 @@
import java.util.List;
/**
- * {@link AbstractRecordListView} specialized to {@link EmployeeKey} values.
+ * {@link AbstractProxyListView} specialized to {@link EmployeeKey} values.
*/
-public class EmployeeListView extends AbstractRecordListView<EmployeeRecord> {
+public class EmployeeListView extends AbstractProxyListView<EmployeeProxy> {
interface Binder extends UiBinder<HTMLPanel, EmployeeListView> {
}
private static final Binder BINDER = GWT.create(Binder.class);
- @UiField CellTable<EmployeeRecord> table;
+ @UiField CellTable<EmployeeProxy> table;
@UiField Button newButton;
public EmployeeListView() {
init(BINDER.createAndBindUi(this), table, newButton, getColumns());
}
- protected List<PropertyColumn<EmployeeRecord, ?>> getColumns() {
+ protected List<PropertyColumn<EmployeeProxy, ?>> getColumns() {
// TODO These should be <g:col> elements in a <g:table> in the ui.xml file
- List<PropertyColumn<EmployeeRecord, ?>> columns = new ArrayList<PropertyColumn<EmployeeRecord, ?>>();
+ List<PropertyColumn<EmployeeProxy, ?>> columns = new ArrayList<PropertyColumn<EmployeeProxy, ?>>();
- columns.add(PropertyColumn.<EmployeeRecord> getStringPropertyColumn(EmployeeRecord.userName));
+ columns.add(PropertyColumn.<EmployeeProxy> getStringPropertyColumn(EmployeeProxy.userName));
- columns.add(PropertyColumn.<EmployeeRecord> getStringPropertyColumn(EmployeeRecord.displayName));
+ columns.add(PropertyColumn.<EmployeeProxy> getStringPropertyColumn(EmployeeProxy.displayName));
- columns.add(PropertyColumn.<EmployeeRecord> getStringPropertyColumn(EmployeeRecord.password));
+ columns.add(PropertyColumn.<EmployeeProxy> getStringPropertyColumn(EmployeeProxy.password));
- columns.add(new PropertyColumn<EmployeeRecord, EmployeeRecord>(
- EmployeeRecord.supervisor, EmployeeRenderer.instance()));
+ columns.add(new PropertyColumn<EmployeeProxy, EmployeeProxy>(
+ EmployeeProxy.supervisor, EmployeeRenderer.instance()));
return columns;
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeRenderer.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeRenderer.java
index be6c5eb..497a0d7 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeRenderer.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/employee/EmployeeRenderer.java
@@ -16,13 +16,13 @@
package com.google.gwt.sample.expenses.client.ui.employee;
import com.google.gwt.app.place.ProxyRenderer;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
/**
- * Renders {@link EmployeeRecord}s for display to the user. Requires the
+ * Renders {@link EmployeeProxy}s for display to the user. Requires the
* displayName property to have been fetched.
*/
-public class EmployeeRenderer extends ProxyRenderer<EmployeeRecord> {
+public class EmployeeRenderer extends ProxyRenderer<EmployeeProxy> {
private static EmployeeRenderer INSTANCE;
public static EmployeeRenderer instance() {
@@ -37,7 +37,7 @@
super(new String[] { "displayName"} );
}
- public String render(EmployeeRecord object) {
+ public String render(EmployeeProxy object) {
if (object == null) {
return "";
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportDetailsView.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportDetailsView.java
index ec362aa..0277ce1 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportDetailsView.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportDetailsView.java
@@ -15,13 +15,13 @@
*/
package com.google.gwt.sample.expenses.client.ui.report;
-import com.google.gwt.app.place.RecordDetailsView;
+import com.google.gwt.app.place.ProxyDetailsView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.i18n.client.DateTimeFormatRenderer;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.sample.expenses.client.ui.employee.EmployeeRenderer;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
@@ -34,13 +34,13 @@
/**
* Details view for employee records.
*/
-public class ReportDetailsView extends Composite implements RecordDetailsView<ReportRecord> {
+public class ReportDetailsView extends Composite implements ProxyDetailsView<ReportProxy> {
interface Binder extends UiBinder<HTMLPanel, ReportDetailsView> {
}
private static final Binder BINDER = GWT.create(Binder.class);
- ReportRecord record;
+ ReportProxy record;
@UiField
SpanElement idSpan;
@@ -75,7 +75,7 @@
return Window.confirm(msg);
}
- public ReportRecord getValue() {
+ public ReportProxy getValue() {
return record;
}
@@ -93,7 +93,7 @@
this.delegate = delegate;
}
- public void setValue(ReportRecord record) {
+ public void setValue(ReportProxy record) {
this.record = record;
purpose.setInnerText(record.getPurpose());
notes.setInnerText(record.getNotes());
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportEditView.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportEditView.java
index 0996f6f..1916873 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportEditView.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportEditView.java
@@ -16,14 +16,14 @@
package com.google.gwt.sample.expenses.client.ui.report;
import com.google.gwt.app.client.EditorSupport;
-import com.google.gwt.app.place.RecordEditView;
+import com.google.gwt.app.place.ProxyEditView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.sample.expenses.client.ui.employee.EmployeeRenderer;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
@@ -43,11 +43,11 @@
* Edit view for employee records.
*/
public class ReportEditView extends Composite implements
- RecordEditView<ReportRecord> {
+ ProxyEditView<ReportProxy> {
interface Binder extends UiBinder<HTMLPanel, ReportEditView> {
}
- interface DataBinder extends EditorSupport<ReportRecord, ReportEditView> {
+ interface DataBinder extends EditorSupport<ReportProxy, ReportEditView> {
}
private static final Binder BINDER = GWT.create(Binder.class);
@@ -55,10 +55,10 @@
@UiField TextBox notes;
@UiField TextBox purpose;
- @UiField(provided = true) ValueListBox<EmployeeRecord> reporter =
- new ValueListBox<EmployeeRecord>(EmployeeRenderer.instance());
- @UiField(provided = true) ValueListBox<EmployeeRecord> approvedSupervisor =
- new ValueListBox<EmployeeRecord>(EmployeeRenderer.instance());
+ @UiField(provided = true) ValueListBox<EmployeeProxy> reporter =
+ new ValueListBox<EmployeeProxy>(EmployeeRenderer.instance());
+ @UiField(provided = true) ValueListBox<EmployeeProxy> approvedSupervisor =
+ new ValueListBox<EmployeeProxy>(EmployeeRenderer.instance());
@UiField DateBox created;
@UiField Button cancel;
@UiField Button save;
@@ -70,7 +70,7 @@
private Delegate delegate;
- private ReportRecord record;
+ private ReportProxy record;
public ReportEditView() {
initWidget(BINDER.createAndBindUi(this));
@@ -85,7 +85,7 @@
return DATA_BINDER.getPaths();
}
- public ReportRecord getValue() {
+ public ReportProxy getValue() {
return record;
}
@@ -107,7 +107,7 @@
this.delegate = delegate;
}
- public void setEmployeePickerValues(Collection<EmployeeRecord> values) {
+ public void setEmployeePickerValues(Collection<EmployeeProxy> values) {
approvedSupervisor.setAcceptableValues(values);
reporter.setAcceptableValues(values);
}
@@ -117,7 +117,7 @@
save.setEnabled(enabled);
}
- public void setValue(ReportRecord value) {
+ public void setValue(ReportProxy value) {
this.record = value;
DATA_BINDER.setValue(this, value);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportListView.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportListView.java
index ba66572..66fe1f5 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportListView.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ui/report/ReportListView.java
@@ -15,13 +15,13 @@
*/
package com.google.gwt.sample.expenses.client.ui.report;
-import com.google.gwt.app.place.AbstractRecordListView;
+import com.google.gwt.app.place.AbstractProxyListView;
import com.google.gwt.app.place.PropertyColumn;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.DateTimeFormatRenderer;
-import com.google.gwt.sample.expenses.client.request.EmployeeRecord;
-import com.google.gwt.sample.expenses.client.request.ReportRecord;
+import com.google.gwt.sample.expenses.client.request.EmployeeProxy;
+import com.google.gwt.sample.expenses.client.request.ReportProxy;
import com.google.gwt.sample.expenses.client.ui.employee.EmployeeRenderer;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
@@ -34,38 +34,38 @@
import java.util.List;
/**
- * {@link AbstractRecordListView} specialized to {@link EmployeeKey} values.
+ * {@link AbstractProxyListView} specialized to {@link EmployeeKey} values.
* <p>
* TODO This should be a <g:table> in a ui.xml file
*/
-public class ReportListView extends AbstractRecordListView<ReportRecord> {
+public class ReportListView extends AbstractProxyListView<ReportProxy> {
interface Binder extends UiBinder<HTMLPanel, ReportListView> {
}
private static final Binder BINDER = GWT.create(Binder.class);
- @UiField CellTable<ReportRecord> table;
+ @UiField CellTable<ReportProxy> table;
@UiField Button newButton;
public ReportListView() {
init(BINDER.createAndBindUi(this), table, newButton, getColumns());
}
- protected List<PropertyColumn<ReportRecord, ?>> getColumns() {
+ protected List<PropertyColumn<ReportProxy, ?>> getColumns() {
// TODO These should be <g:col> elements in a <g:table> in the ui.xml file
- List<PropertyColumn<ReportRecord, ?>> columns = new ArrayList<PropertyColumn<ReportRecord, ?>>();
+ List<PropertyColumn<ReportProxy, ?>> columns = new ArrayList<PropertyColumn<ReportProxy, ?>>();
- columns.add(new PropertyColumn<ReportRecord, Date>(ReportRecord.created,
+ columns.add(new PropertyColumn<ReportProxy, Date>(ReportProxy.created,
new DateTimeFormatRenderer(DateTimeFormat.getShortDateFormat())));
- columns.add(PropertyColumn.<ReportRecord> getStringPropertyColumn(ReportRecord.purpose));
+ columns.add(PropertyColumn.<ReportProxy> getStringPropertyColumn(ReportProxy.purpose));
- columns.add(new PropertyColumn<ReportRecord, EmployeeRecord>(
- ReportRecord.reporter, EmployeeRenderer.instance()));
+ columns.add(new PropertyColumn<ReportProxy, EmployeeProxy>(
+ ReportProxy.reporter, EmployeeRenderer.instance()));
- columns.add(new PropertyColumn<ReportRecord, EmployeeRecord>(
- ReportRecord.approvedSupervisor, EmployeeRenderer.instance()));
+ columns.add(new PropertyColumn<ReportProxy, EmployeeProxy>(
+ ReportProxy.approvedSupervisor, EmployeeRenderer.instance()));
return columns;
}
diff --git a/user/src/com/google/gwt/app/client/EditorSupport.java b/user/src/com/google/gwt/app/client/EditorSupport.java
index 32fb11d..11aa187 100644
--- a/user/src/com/google/gwt/app/client/EditorSupport.java
+++ b/user/src/com/google/gwt/app/client/EditorSupport.java
@@ -15,8 +15,8 @@
*/
package com.google.gwt.app.client;
-import com.google.gwt.app.place.RecordEditView;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.app.place.ProxyEditView;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import java.util.Map;
@@ -27,12 +27,12 @@
* </span>
* </p>
* Implemented by objects that provide data binding support for
- * instances of {@link RecordEditView}.
+ * instances of {@link ProxyEditView}.
*
* @param <R> the Record type
* @param <V> the View type
*/
-public interface EditorSupport<R extends Record, V extends RecordEditView<R>> {
+public interface EditorSupport<R extends EntityProxy, V extends ProxyEditView<R>> {
String[] getPaths();
void init(final V view);
diff --git a/user/src/com/google/gwt/app/client/NullParser.java b/user/src/com/google/gwt/app/client/NullParser.java
index a03d929..d8acee9 100644
--- a/user/src/com/google/gwt/app/client/NullParser.java
+++ b/user/src/com/google/gwt/app/client/NullParser.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.app.client;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.text.shared.Parser;
import java.text.ParseException;
@@ -28,14 +28,14 @@
* A no-op renderer, always returns null
* @param <T> a Record type.
*/
-public class NullParser<T extends Record> implements Parser<T> {
+public class NullParser<T extends EntityProxy> implements Parser<T> {
private static NullParser INSTANCE;
/**
* @return the instance of the null parser
*/
- public static <T extends Record> Parser<T> instance() {
+ public static <T extends EntityProxy> Parser<T> instance() {
if (INSTANCE == null) {
INSTANCE = new NullParser<T>();
}
diff --git a/user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java b/user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java
similarity index 78%
rename from user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java
rename to user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java
index 4824f91..dd73b71 100644
--- a/user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java
+++ b/user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java
@@ -18,8 +18,8 @@
import com.google.gwt.app.place.ProxyPlace.Operation;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.SyncResult;
@@ -36,25 +36,25 @@
* </p>
* Abstract activity for editing a record.
*
- * @param <R> the type of Record being edited
+ * @param <P> the type of Proxy being edited
*/
-public abstract class AbstractRecordEditActivity<R extends Record> implements
- Activity, RecordEditView.Delegate {
+public abstract class AbstractProxyEditActivity<P extends EntityProxy> implements
+ Activity, ProxyEditView.Delegate {
private RequestObject<Void> requestObject;
private final boolean creating;
- private final RecordEditView<R> view;
- private final Class<R> proxyType;
+ private final ProxyEditView<P> view;
+ private final Class<P> proxyType;
private final RequestFactory requests;
private final PlaceController placeController;
- private R record;
+ private P record;
private Long futureId;
private Display display;
- public AbstractRecordEditActivity(RecordEditView<R> view, R record,
- Class<R> proxyType, boolean creating, RequestFactory requests,
+ public AbstractProxyEditActivity(ProxyEditView<P> view, P record,
+ Class<P> proxyType, boolean creating, RequestFactory requests,
PlaceController placeController) {
this.view = view;
@@ -77,11 +77,11 @@
}
}
- public R getRecord() {
+ public P getRecord() {
return record;
}
- public RecordEditView<R> getView() {
+ public ProxyEditView<P> getView() {
return view;
}
@@ -119,7 +119,7 @@
boolean hasViolations = false;
for (SyncResult syncResult : response) {
- Record syncRecord = syncResult.getRecord();
+ EntityProxy syncRecord = syncResult.getProxy();
if (creating) {
if (futureId == null || !futureId.equals(syncResult.getFutureId())) {
continue;
@@ -154,15 +154,15 @@
view.setCreating(creating);
if (creating) {
- R tempRecord = requests.create(proxyType);
+ P tempRecord = requests.create(proxyType);
futureId = tempRecord.getId();
doStart(display, tempRecord);
} else {
- RecordRequest<R> findRequest = getFindRequest(Value.of(getRecord().getId()));
- findRequest.with(getView().getPaths()).fire(new Receiver<R>() {
- public void onSuccess(R record, Set<SyncResult> syncResults) {
- if (AbstractRecordEditActivity.this.display != null) {
- doStart(AbstractRecordEditActivity.this.display, record);
+ ProxyRequest<P> findRequest = getFindRequest(Value.of(getRecord().getId()));
+ findRequest.with(getView().getPaths()).fire(new Receiver<P>() {
+ public void onSuccess(P record, Set<SyncResult> syncResults) {
+ if (AbstractProxyEditActivity.this.display != null) {
+ doStart(AbstractProxyEditActivity.this.display, record);
}
}
});
@@ -190,18 +190,18 @@
/**
* Called to fetch the details of the edited record.
*/
- protected abstract RecordRequest<R> getFindRequest(Value<Long> id);
+ protected abstract ProxyRequest<P> getFindRequest(Value<Long> id);
- protected abstract RequestObject<Void> getPersistRequest(R record);
+ protected abstract RequestObject<Void> getPersistRequest(P record);
@SuppressWarnings("unchecked")
- private R cast(Record syncRecord) {
- return (R) syncRecord;
+ private P cast(EntityProxy syncRecord) {
+ return (P) syncRecord;
}
- private void doStart(final Display display, R record) {
+ private void doStart(final Display display, P record) {
requestObject = getPersistRequest(record);
- R editableRecord = requestObject.edit(record);
+ P editableRecord = requestObject.edit(record);
view.setEnabled(true);
view.setValue(editableRecord);
view.showErrors(null);
diff --git a/user/src/com/google/gwt/app/place/AbstractRecordListActivity.java b/user/src/com/google/gwt/app/place/AbstractProxyListActivity.java
similarity index 79%
rename from user/src/com/google/gwt/app/place/AbstractRecordListActivity.java
rename to user/src/com/google/gwt/app/place/AbstractProxyListActivity.java
index 3f29955..15c60d2 100644
--- a/user/src/com/google/gwt/app/place/AbstractRecordListActivity.java
+++ b/user/src/com/google/gwt/app/place/AbstractProxyListActivity.java
@@ -19,8 +19,8 @@
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.SyncResult;
import com.google.gwt.requestfactory.shared.WriteOperation;
@@ -44,27 +44,27 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Abstract activity for requesting and displaying a list of {@link Record}.
+ * Abstract activity for requesting and displaying a list of {@link EntityProxy}.
* <p>
* Subclasses must:
*
* <ul>
* <li>implement methods to provide a full count, and request a specific
- * <li>provide a {@link RecordListView}
+ * <li>provide a {@link ProxyListView}
* <li>respond to "show details" commands
* </ul>
*
* Only the properties required by the view will be requested.
*
- * @param <R> the type of {@link Record} listed
+ * @param <P> the type of {@link EntityProxy} listed
*/
-public abstract class AbstractRecordListActivity<R extends Record> implements
- Activity, RecordListView.Delegate<R> {
+public abstract class AbstractProxyListActivity<P extends EntityProxy> implements
+ Activity, ProxyListView.Delegate<P> {
/**
* Used by the table and its selection model, to define record equality via
* id.
*/
- private static class RecordKeyProvider<R extends Record> implements
+ private static class RecordKeyProvider<R extends EntityProxy> implements
ProvidesKey<R> {
public Object getKey(R item) {
return item == null ? null : item.getId();
@@ -78,43 +78,43 @@
private final RequestFactory requests;
private final PlaceController placeController;
- private final SingleSelectionModel<R> selectionModel;
- private final Class<R> proxyType;
+ private final SingleSelectionModel<P> selectionModel;
+ private final Class<P> proxyType;
/**
* Used by the table and its selection model to rely on record id for
* equality.
*/
- private final RecordKeyProvider<R> keyProvider = new RecordKeyProvider<R>();
+ private final RecordKeyProvider<P> keyProvider = new RecordKeyProvider<P>();
private HandlerRegistration rangeChangeHandler;
- private RecordListView<R> view;
+ private ProxyListView<P> view;
private Display display;
- public AbstractRecordListActivity(RequestFactory requests,
- PlaceController placeController, RecordListView<R> view,
- Class<R> proxyType) {
+ public AbstractProxyListActivity(RequestFactory requests,
+ PlaceController placeController, ProxyListView<P> view,
+ Class<P> proxyType) {
this.view = view;
this.requests = requests;
this.placeController = placeController;
this.proxyType = proxyType;
view.setDelegate(this);
- final HasData<R> hasData = view.asHasData();
+ final HasData<P> hasData = view.asHasData();
rangeChangeHandler = hasData.addRangeChangeHandler(new RangeChangeEvent.Handler() {
public void onRangeChange(RangeChangeEvent event) {
- AbstractRecordListActivity.this.onRangeChanged(hasData);
+ AbstractProxyListActivity.this.onRangeChanged(hasData);
}
});
- selectionModel = new SingleSelectionModel<R>();
+ selectionModel = new SingleSelectionModel<P>();
selectionModel.setKeyProvider(keyProvider);
hasData.setSelectionModel(selectionModel);
- ((AbstractHasData<R>) hasData).setKeyProvider(keyProvider);
+ ((AbstractHasData<P>) hasData).setKeyProvider(keyProvider);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
- R selectedObject = selectionModel.getSelectedObject();
+ P selectedObject = selectionModel.getSelectedObject();
if (selectedObject != null) {
showDetails(selectedObject);
}
@@ -127,7 +127,7 @@
Operation.CREATE));
}
- public RecordListView<R> getView() {
+ public ProxyListView<P> getView() {
return view;
}
@@ -142,18 +142,18 @@
/**
* Called by the table as it needs data.
*/
- public void onRangeChanged(HasData<R> listView) {
+ public void onRangeChanged(HasData<P> listView) {
final Range range = listView.getVisibleRange();
- final Receiver<List<R>> callback = new Receiver<List<R>>() {
- public void onSuccess(List<R> values, Set<SyncResult> syncResults) {
+ final Receiver<List<P>> callback = new Receiver<List<P>>() {
+ public void onSuccess(List<P> values, Set<SyncResult> syncResults) {
if (view == null) {
// This activity is dead
return;
}
recordToRow.clear();
for (int i = 0, row = range.getStart(); i < values.size(); i++, row++) {
- R record = values.get(i);
+ P record = values.get(i);
recordToRow.put(record.getId(), row);
}
getView().asHasData().setRowData(range.getStart(), values);
@@ -176,9 +176,9 @@
/**
* Select the given record, or clear the selection if called with null.
*/
- public void select(R record) {
+ public void select(P record) {
if (record == null) {
- R selected = selectionModel.getSelectedObject();
+ P selected = selectionModel.getSelectedObject();
if (selected != null) {
selectionModel.setSelected(selected, false);
}
@@ -198,7 +198,7 @@
updateSelection(placeController.getWhere());
}
- public void update(WriteOperation writeOperation, R record) {
+ public void update(WriteOperation writeOperation, P record) {
switch (writeOperation) {
case UPDATE:
update(record);
@@ -218,7 +218,7 @@
}
}
- protected abstract RecordListRequest<R> createRangeRequest(Range range);
+ protected abstract ProxyListRequest<P> createRangeRequest(Range range);
protected abstract void fireCountRequest(Receiver<Long> callback);
@@ -228,12 +228,12 @@
*
* @param record the chosen record
*/
- protected void showDetails(R record) {
+ protected void showDetails(P record) {
placeController.goTo(new ProxyPlace(record, Operation.DETAILS));
}
private void fireRangeRequest(final Range range,
- final Receiver<List<R>> callback) {
+ final Receiver<List<P>> callback) {
createRangeRequest(range).with(getView().getPaths()).fire(
callback);
}
@@ -241,7 +241,7 @@
private void getLastPage() {
fireCountRequest(new Receiver<Long>() {
public void onSuccess(Long response, Set<SyncResult> syncResults) {
- HasData<R> table = getView().asHasData();
+ HasData<P> table = getView().asHasData();
int rows = response.intValue();
table.setRowCount(rows, true);
int pageSize = table.getVisibleRange().getLength();
@@ -267,16 +267,16 @@
@SuppressWarnings("unchecked")
private void selectCoerced(Place newPlace) {
- select((R) ((ProxyPlace) newPlace).getProxy());
+ select((P) ((ProxyPlace) newPlace).getProxy());
}
- private void update(R record) {
+ private void update(P record) {
final Integer row = recordToRow.get(record.getId());
if (row == null) {
return;
}
- fireRangeRequest(new Range(row, 1), new Receiver<List<R>>() {
- public void onSuccess(List<R> response, Set<SyncResult> syncResults) {
+ fireRangeRequest(new Range(row, 1), new Receiver<List<P>>() {
+ public void onSuccess(List<P> response, Set<SyncResult> syncResults) {
getView().asHasData().setRowData(row,
Collections.singletonList(response.get(0)));
}
diff --git a/user/src/com/google/gwt/app/place/AbstractRecordListView.java b/user/src/com/google/gwt/app/place/AbstractProxyListView.java
similarity index 76%
rename from user/src/com/google/gwt/app/place/AbstractRecordListView.java
rename to user/src/com/google/gwt/app/place/AbstractProxyListView.java
index b9bc5b6..365f9d3 100644
--- a/user/src/com/google/gwt/app/place/AbstractRecordListView.java
+++ b/user/src/com/google/gwt/app/place/AbstractProxyListView.java
@@ -17,7 +17,7 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
@@ -35,24 +35,24 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Abstract implementation of RecordListView. Subclasses must call {@link #init}
+ * Abstract implementation of ProxyListView. Subclasses must call {@link #init}
* with the root widget, its {@link CellTable}, and a list of
* {@link PropertyColumn}.
*
- * @param <R> the type of the records
+ * @param <P> the type of the proxy
*/
-public abstract class AbstractRecordListView<R extends Record> extends
- Composite implements RecordListView<R> {
+public abstract class AbstractProxyListView<P extends EntityProxy> extends
+ Composite implements ProxyListView<P> {
- private CellTable<R> table;
+ private CellTable<P> table;
private Set<String> paths = new HashSet<String>();
- private Delegate<R> delegate;
+ private Delegate<P> delegate;
- public HasData<R> asHasData() {
+ public HasData<P> asHasData() {
return table;
}
- public AbstractRecordListView<R> asWidget() {
+ public AbstractProxyListView<P> asWidget() {
return this;
}
@@ -60,16 +60,16 @@
return paths.toArray(new String[paths.size()]);
}
- public void setDelegate(final Delegate<R> delegate) {
+ public void setDelegate(final Delegate<P> delegate) {
this.delegate = delegate;
}
- protected void init(Widget root, CellTable<R> table, Button newButton,
- List<PropertyColumn<R, ?>> columns) {
+ protected void init(Widget root, CellTable<P> table, Button newButton,
+ List<PropertyColumn<P, ?>> columns) {
super.initWidget(root);
this.table = table;
- for (PropertyColumn<R, ?> column : columns) {
+ for (PropertyColumn<P, ?> column : columns) {
table.addColumn(column, column.getDisplayName());
paths.addAll(Arrays.asList(column.getPaths()));
}
diff --git a/user/src/com/google/gwt/app/place/PropertyColumn.java b/user/src/com/google/gwt/app/place/PropertyColumn.java
index 24667cf..8c73cf2 100644
--- a/user/src/com/google/gwt/app/place/PropertyColumn.java
+++ b/user/src/com/google/gwt/app/place/PropertyColumn.java
@@ -16,7 +16,7 @@
package com.google.gwt.app.place;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.text.shared.PassthroughRenderer;
import com.google.gwt.text.shared.Renderer;
import com.google.gwt.user.cellview.client.TextColumn;
@@ -34,8 +34,8 @@
* @param <R> the type of record in this table
* @param <T> value type of the property
*/
-public class PropertyColumn<R extends Record, T> extends TextColumn<R> {
- public static <R extends Record> PropertyColumn<R, String> getStringPropertyColumn(
+public class PropertyColumn<R extends EntityProxy, T> extends TextColumn<R> {
+ public static <R extends EntityProxy> PropertyColumn<R, String> getStringPropertyColumn(
Property<String> property) {
return new PropertyColumn<R, String>(property,
PassthroughRenderer.instance());
diff --git a/user/src/com/google/gwt/app/place/PropertyView.java b/user/src/com/google/gwt/app/place/PropertyView.java
index 158e490..e8842a7 100644
--- a/user/src/com/google/gwt/app/place/PropertyView.java
+++ b/user/src/com/google/gwt/app/place/PropertyView.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.app.place;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
/**
* <p>
@@ -23,11 +23,11 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * A view that displays a set of property values for a type of {@link Record}.
+ * A view that displays a set of property values for a type of {@link EntityProxy}.
*
* @param <R> the type of the record
*/
-public interface PropertyView<R extends Record> {
+public interface PropertyView<R extends EntityProxy> {
/**
* @return the set of properties this view displays
diff --git a/user/src/com/google/gwt/app/place/RecordDetailsView.java b/user/src/com/google/gwt/app/place/ProxyDetailsView.java
similarity index 90%
rename from user/src/com/google/gwt/app/place/RecordDetailsView.java
rename to user/src/com/google/gwt/app/place/ProxyDetailsView.java
index f35dd05..6c3dbcf 100644
--- a/user/src/com/google/gwt/app/place/RecordDetailsView.java
+++ b/user/src/com/google/gwt/app/place/ProxyDetailsView.java
@@ -25,9 +25,9 @@
* </p>
* Implemented by views that show the details of an object.
*
- * @param <R> the type of object to show
+ * @param <P> the type of object to show
*/
-public interface RecordDetailsView<R> extends TakesValue<R>, IsWidget {
+public interface ProxyDetailsView<P> extends TakesValue<P>, IsWidget {
/**
* Implemented by the owner of the view.
diff --git a/user/src/com/google/gwt/app/place/RecordEditView.java b/user/src/com/google/gwt/app/place/ProxyEditView.java
similarity index 82%
rename from user/src/com/google/gwt/app/place/RecordEditView.java
rename to user/src/com/google/gwt/app/place/ProxyEditView.java
index adb2235..854ab2a 100644
--- a/user/src/com/google/gwt/app/place/RecordEditView.java
+++ b/user/src/com/google/gwt/app/place/ProxyEditView.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.app.place;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.user.client.TakesValue;
import java.util.Map;
@@ -26,12 +26,12 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Implemented by views that edit {@link Record}s.
+ * Implemented by views that edit {@link EntityProxy}s.
*
- * @param <R> the type of the record
+ * @param <P> the type of the proxy
*/
-public interface RecordEditView<R extends Record> extends TakesValue<R>,
- IsWidget, PropertyView<R> {
+public interface ProxyEditView<P extends EntityProxy> extends TakesValue<P>,
+ IsWidget, PropertyView<P> {
/**
* Implemented by the owner of the view.
diff --git a/user/src/com/google/gwt/app/place/ProxyListPlace.java b/user/src/com/google/gwt/app/place/ProxyListPlace.java
index fa37d2e..aca1886 100644
--- a/user/src/com/google/gwt/app/place/ProxyListPlace.java
+++ b/user/src/com/google/gwt/app/place/ProxyListPlace.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.app.place;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestFactory;
/**
@@ -44,9 +44,9 @@
}
}
- private final Class<? extends Record> proxyType;
+ private final Class<? extends EntityProxy> proxyType;
- public ProxyListPlace(Class<? extends Record> proxyType) {
+ public ProxyListPlace(Class<? extends EntityProxy> proxyType) {
this.proxyType = proxyType;
}
@@ -68,7 +68,7 @@
return true;
}
- public Class<? extends Record> getProxyClass() {
+ public Class<? extends EntityProxy> getProxyClass() {
return proxyType;
}
diff --git a/user/src/com/google/gwt/app/place/RecordListView.java b/user/src/com/google/gwt/app/place/ProxyListView.java
similarity index 77%
rename from user/src/com/google/gwt/app/place/RecordListView.java
rename to user/src/com/google/gwt/app/place/ProxyListView.java
index de3e085..197a32b 100644
--- a/user/src/com/google/gwt/app/place/RecordListView.java
+++ b/user/src/com/google/gwt/app/place/ProxyListView.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.app.place;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.view.client.HasData;
/**
@@ -24,29 +24,29 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * A view of a list of {@link Record}s, which declares which properties it is
+ * A view of a list of {@link EntityProxy}s, which declares which properties it is
* able to display.
* <p>
* It is expected that such views will typically (eventually) be defined largely
* in ui.xml files which declare the properties of interest, which is why the
* view is a source of a property set rather than a receiver of one.
*
- * @param <R> the type of the records to display
+ * @param <P> the type of the records to display
*/
-public interface RecordListView<R extends Record> extends IsWidget, PropertyView<R> {
+public interface ProxyListView<P extends EntityProxy> extends IsWidget, PropertyView<P> {
/**
* Implemented by the owner of a RecordTableView.
*
* @param <R> the type of the records to display
*/
- interface Delegate<R extends Record> {
+ interface Delegate<R extends EntityProxy> {
void createClicked();
}
- HasData<R> asHasData();
+ HasData<P> asHasData();
/**
* Sets the delegate.
*/
- void setDelegate(Delegate<R> delegate);
+ void setDelegate(Delegate<P> delegate);
}
diff --git a/user/src/com/google/gwt/app/place/ProxyPlace.java b/user/src/com/google/gwt/app/place/ProxyPlace.java
index 679908e..4fab0e7 100644
--- a/user/src/com/google/gwt/app/place/ProxyPlace.java
+++ b/user/src/com/google/gwt/app/place/ProxyPlace.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.app.place;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestFactory;
/**
@@ -52,15 +52,15 @@
}
}
- private final Record proxy;
+ private final EntityProxy proxy;
private final Operation operation;
- public ProxyPlace(Record record) {
+ public ProxyPlace(EntityProxy record) {
this(record, Operation.DETAILS);
}
- public ProxyPlace(Record record, Operation operation) {
+ public ProxyPlace(EntityProxy record, Operation operation) {
this.operation = operation;
this.proxy = record;
}
@@ -93,7 +93,7 @@
return operation;
}
- public Record getProxy() {
+ public EntityProxy getProxy() {
return proxy;
}
diff --git a/user/src/com/google/gwt/app/rebind/EditorSupportGenerator.java b/user/src/com/google/gwt/app/rebind/EditorSupportGenerator.java
index 695d8ed..2ee5bee 100644
--- a/user/src/com/google/gwt/app/rebind/EditorSupportGenerator.java
+++ b/user/src/com/google/gwt/app/rebind/EditorSupportGenerator.java
@@ -31,7 +31,7 @@
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.TakesValue;
import com.google.gwt.user.client.ui.HasText;
@@ -182,7 +182,7 @@
stringType = generatorContext.getTypeOracle().findType(
String.class.getName());
jrecordType = generatorContext.getTypeOracle().findType(
- Record.class.getName());
+ EntityProxy.class.getName());
writeGetPathsMethod(sw, recordType);
writeInit(sw, viewType);
writeIsChangedMethod(sw, recordType, viewType);
diff --git a/user/src/com/google/gwt/requestfactory/client/LoginWidget.java b/user/src/com/google/gwt/requestfactory/client/LoginWidget.java
index d1b75d8..2ea6a6c 100644
--- a/user/src/com/google/gwt/requestfactory/client/LoginWidget.java
+++ b/user/src/com/google/gwt/requestfactory/client/LoginWidget.java
@@ -19,7 +19,7 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.requestfactory.shared.UserInformationRecord;
+import com.google.gwt.requestfactory.shared.UserInformationProxy;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
@@ -41,7 +41,7 @@
initWidget(BINDER.createAndBindUi(this));
}
- public void setUserInformation(UserInformationRecord info) {
+ public void setUserInformation(UserInformationProxy info) {
name.setInnerText(info.getName());
logoutUrl = info.getLogoutUrl();
}
diff --git a/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java b/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
index 947f700..a3063af 100644
--- a/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
+++ b/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
@@ -17,7 +17,7 @@
import com.google.gwt.editor.client.Editor;
import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
@@ -49,7 +49,7 @@
* @param <E> the type of Editor that will edit the Record
* @see com.google.gwt.requestfactory.client.testing.MockRequestFactoryEditorDriver
*/
-public interface RequestFactoryEditorDriver<P extends Record, E extends Editor<? super P>> {
+public interface RequestFactoryEditorDriver<P extends EntityProxy, E extends Editor<? super P>> {
/**
* Initialize the Editor and its sub-editors with data.
*/
diff --git a/user/src/com/google/gwt/requestfactory/client/SyncResultImpl.java b/user/src/com/google/gwt/requestfactory/client/SyncResultImpl.java
index 6e6228f..7fd3136 100644
--- a/user/src/com/google/gwt/requestfactory/client/SyncResultImpl.java
+++ b/user/src/com/google/gwt/requestfactory/client/SyncResultImpl.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.requestfactory.client;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.SyncResult;
import java.util.Map;
@@ -30,11 +30,11 @@
*/
public class SyncResultImpl implements SyncResult {
- private final Record record;
+ private final EntityProxy record;
private final Map<String, String> violations;
private final Long futureId;
- public SyncResultImpl(Record record, Map<String, String> violations, Long futureId) {
+ public SyncResultImpl(EntityProxy record, Map<String, String> violations, Long futureId) {
this.record = record;
this.violations = violations;
this.futureId = futureId;
@@ -44,7 +44,7 @@
return futureId;
}
- public Record getRecord() {
+ public EntityProxy getProxy() {
return record;
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java b/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java
index 58afb8e..82d2439 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java
@@ -16,8 +16,8 @@
package com.google.gwt.requestfactory.client.impl;
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
import com.google.gwt.requestfactory.shared.SyncResult;
import java.util.ArrayList;
@@ -33,17 +33,17 @@
* Abstract implementation of
* {@link com.google.gwt.requestfactory.shared.RequestObject
* RequestFactory.RequestObject} for requests that return lists of
- * {@link Record}.
+ * {@link EntityProxy}.
*
* @param <T> the type of entities returned
* @param <R> this request type
*/
public abstract class //
-AbstractJsonListRequest<T extends Record, R extends AbstractJsonListRequest<T, R>> //
- extends AbstractRequest<List<T>, R> implements RecordListRequest<T> {
- protected final RecordSchema<? extends T> schema;
+AbstractJsonListRequest<T extends EntityProxy, R extends AbstractJsonListRequest<T, R>> //
+ extends AbstractRequest<List<T>, R> implements ProxyListRequest<T> {
+ protected final ProxySchema<? extends T> schema;
- public AbstractJsonListRequest(RecordSchema<? extends T> schema,
+ public AbstractJsonListRequest(ProxySchema<? extends T> schema,
RequestFactoryJsonImpl requestService) {
super(requestService);
this.schema = schema;
@@ -52,10 +52,10 @@
@Override
public void handleResult(Object jsoResult, Set<SyncResult> syncResults) {
- JsArray<RecordJsoImpl> valueJsos = (JsArray<RecordJsoImpl>) jsoResult;
+ JsArray<ProxyJsoImpl> valueJsos = (JsArray<ProxyJsoImpl>) jsoResult;
List<T> valueList = new ArrayList<T>(valueJsos.length());
for (int i = 0; i < valueJsos.length(); i++) {
- RecordJsoImpl jso = valueJsos.get(i);
+ ProxyJsoImpl jso = valueJsos.get(i);
jso.setSchema(schema);
valueList.add(schema.create(jso));
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java b/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java
index 2eedacd..67a7ca6 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java
@@ -15,8 +15,8 @@
*/
package com.google.gwt.requestfactory.client.impl;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.SyncResult;
import java.util.Set;
@@ -26,18 +26,18 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span> </p> Abstract implementation of {@link com.google.gwt.requestfactory.shared.RequestObject
* RequestFactory.RequestObject} for requests that return single instances of
- * {@link Record}.
+ * {@link EntityProxy}.
*
* @param <T> the type of entities returned
* @param <R> this request type
*/
public abstract class //
- AbstractJsonObjectRequest<T extends Record, R extends AbstractJsonObjectRequest<T, R>> //
- extends AbstractRequest<T, R> implements RecordRequest<T> {
+ AbstractJsonObjectRequest<T extends EntityProxy, R extends AbstractJsonObjectRequest<T, R>> //
+ extends AbstractRequest<T, R> implements ProxyRequest<T> {
- protected final RecordSchema<? extends T> schema;
+ protected final ProxySchema<? extends T> schema;
- public AbstractJsonObjectRequest(RecordSchema<? extends T> schema,
+ public AbstractJsonObjectRequest(ProxySchema<? extends T> schema,
RequestFactoryJsonImpl requestService) {
super(requestService);
this.schema = schema;
@@ -46,10 +46,10 @@
@Override
public void handleResult(Object jsoResult, Set<SyncResult> syncResults) {
- RecordJsoImpl jso = (RecordJsoImpl) jsoResult;
+ ProxyJsoImpl jso = (ProxyJsoImpl) jsoResult;
jso.setSchema(schema);
- requestFactory.getValueStore().setRecord(jso, requestFactory);
+ requestFactory.getValueStore().setProxy(jso, requestFactory);
receiver.onSuccess(schema.create(jso), syncResults);
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequest.java b/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequest.java
index 046d68c..78ea281 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequest.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequest.java
@@ -18,7 +18,7 @@
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.requestfactory.shared.Property;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.SyncResult;
@@ -63,10 +63,10 @@
}
@SuppressWarnings("unchecked")
- public <P extends Record> P edit(P record) {
- P returnRecordImpl = (P) ((RecordImpl) record).getSchema().create(
- ((RecordImpl) record).asJso(), ((RecordImpl) record).isFuture());
- ((RecordImpl) returnRecordImpl).setDeltaValueStore(deltaValueStore);
+ public <P extends EntityProxy> P edit(P record) {
+ P returnRecordImpl = (P) ((ProxyImpl) record).getSchema().create(
+ ((ProxyImpl) record).asJso(), ((ProxyImpl) record).isFuture());
+ ((ProxyImpl) returnRecordImpl).setDeltaValueStore(deltaValueStore);
return returnRecordImpl;
}
@@ -96,7 +96,7 @@
}
public void handleResponseText(String responseText) {
- RecordJsoImpl.JsonResults results = RecordJsoImpl.fromResults(responseText);
+ ProxyJsoImpl.JsonResults results = ProxyJsoImpl.fromResults(responseText);
if (results.getException() != null) {
throw new RuntimeException(results.getException());
}
@@ -114,9 +114,9 @@
deltaValueStore = new DeltaValueStoreJsonImpl(valueStore, requestFactory);
}
- public void setSchemaAndRecord(String schemaToken, RecordJsoImpl jso) {
+ public void setSchemaAndRecord(String schemaToken, ProxyJsoImpl jso) {
jso.setSchema(requestFactory.getSchema(schemaToken));
- requestFactory.getValueStore().setRecord(jso, requestFactory);
+ requestFactory.getValueStore().setProxy(jso, requestFactory);
}
public R with(String... propertyRef) {
@@ -141,7 +141,7 @@
if (!related.hasOwnProperty(recordKey)) continue;
var schemaAndId = recordKey.split(/-/, 2);
var jso = related[recordKey];
- this.@com.google.gwt.requestfactory.client.impl.AbstractRequest::setSchemaAndRecord(Ljava/lang/String;Lcom/google/gwt/requestfactory/client/impl/RecordJsoImpl;)(schemaAndId[0], jso);
+ this.@com.google.gwt.requestfactory.client.impl.AbstractRequest::setSchemaAndRecord(Ljava/lang/String;Lcom/google/gwt/requestfactory/client/impl/ProxyJsoImpl;)(schemaAndId[0], jso);
}
}-*/;
}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactoryEditorDriver.java b/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactoryEditorDriver.java
index 06d0531..37c060f 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactoryEditorDriver.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactoryEditorDriver.java
@@ -18,7 +18,7 @@
import com.google.gwt.editor.client.Editor;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.requestfactory.client.RequestFactoryEditorDriver;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
@@ -31,7 +31,7 @@
* @param <R> the type of Record
* @param <E> the type of Editor
*/
-public abstract class AbstractRequestFactoryEditorDriver<R extends Record, E extends Editor<R>>
+public abstract class AbstractRequestFactoryEditorDriver<R extends EntityProxy, E extends Editor<R>>
implements RequestFactoryEditorDriver<R, E> {
private RequestFactoryEditorDelegate<R, E> delegate;
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImpl.java b/user/src/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImpl.java
index 09bbdc7..9d80101 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImpl.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImpl.java
@@ -19,7 +19,7 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.requestfactory.client.SyncResultImpl;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.SyncResult;
import com.google.gwt.requestfactory.shared.WriteOperation;
@@ -109,12 +109,12 @@
private final RequestFactoryJsonImpl requestFactory;
// track C-U-D of CRUD operations
- private final Map<RecordKey, RecordJsoImpl> creates = new HashMap<RecordKey, RecordJsoImpl>();
- private final Map<RecordKey, RecordJsoImpl> updates = new HashMap<RecordKey, RecordJsoImpl>();
+ private final Map<EntityProxyId, ProxyJsoImpl> creates = new HashMap<EntityProxyId, ProxyJsoImpl>();
+ private final Map<EntityProxyId, ProxyJsoImpl> updates = new HashMap<EntityProxyId, ProxyJsoImpl>();
// nothing for deletes because DeltaValueStore is not involved in deletes. The
// operation alone suffices.
- private final Map<RecordKey, WriteOperation> operations = new HashMap<RecordKey, WriteOperation>();
+ private final Map<EntityProxyId, WriteOperation> operations = new HashMap<EntityProxyId, WriteOperation>();
public DeltaValueStoreJsonImpl(ValueStoreJsonImpl master,
RequestFactoryJsonImpl requestFactory) {
@@ -135,7 +135,7 @@
HashSet<String> keys = new HashSet<String>();
ReturnRecord.fillKeys(returnedJso, keys);
- Set<RecordKey> toRemove = new HashSet<RecordKey>();
+ Set<EntityProxyId> toRemove = new HashSet<EntityProxyId>();
if (keys.contains(WriteOperation.CREATE.name())) {
JsArray<ReturnRecord> newRecords = ReturnRecord.getRecords(returnedJso,
WriteOperation.CREATE.name());
@@ -161,23 +161,23 @@
}
}
- for (Map.Entry<RecordKey, RecordJsoImpl> entry : creates.entrySet()) {
- final RecordKey futureKey = entry.getKey();
+ for (Map.Entry<EntityProxyId, ProxyJsoImpl> entry : creates.entrySet()) {
+ final EntityProxyId futureKey = entry.getKey();
// TODO change violationsMap to <Long, String>
Map<String, String> violations = violationsMap.get(futureKey.id);
assert violations != null;
if (violations == NULL_VIOLATIONS) {
Long datastoreId = futureToDatastoreId.get(futureKey.id);
assert datastoreId != null;
- final RecordKey key = new RecordKey(datastoreId, futureKey.schema,
+ final EntityProxyId key = new EntityProxyId(datastoreId, futureKey.schema,
RequestFactoryJsonImpl.NOT_FUTURE);
- RecordJsoImpl value = entry.getValue();
- value.set(Record.id, datastoreId);
- RecordJsoImpl masterRecord = master.records.get(key);
+ ProxyJsoImpl value = entry.getValue();
+ value.set(EntityProxy.id, datastoreId);
+ ProxyJsoImpl masterRecord = master.records.get(key);
assert masterRecord == null;
master.records.put(key, value);
masterRecord = value;
- toRemove.add(new RecordKey(datastoreId, futureKey.schema,
+ toRemove.add(new EntityProxyId(datastoreId, futureKey.schema,
RequestFactoryJsonImpl.IS_FUTURE));
requestFactory.postChangeEvent(masterRecord, WriteOperation.CREATE);
syncResults.add(makeSyncResult(masterRecord, null, futureKey.id));
@@ -198,7 +198,7 @@
int length = deletedRecords.length();
for (int i = 0; i < length; i++) {
- final RecordKey key = new RecordKey(deletedRecords.get(i).getId(),
+ final EntityProxyId key = new EntityProxyId(deletedRecords.get(i).getId(),
requestFactory.getSchema(deletedRecords.get(i).getSchema()),
RequestFactoryJsonImpl.NOT_FUTURE);
Map<String, String> violations = violationsMap.get(key.id);
@@ -210,10 +210,10 @@
* with update events.
*/
if (violations == NULL_VIOLATIONS) {
- requestFactory.postChangeEvent(RecordJsoImpl.create(key.id, 1,
+ requestFactory.postChangeEvent(ProxyJsoImpl.create(key.id, 1,
key.schema), WriteOperation.DELETE);
}
- RecordJsoImpl masterRecord = master.records.get(key);
+ ProxyJsoImpl masterRecord = master.records.get(key);
if (masterRecord != null) {
master.records.remove(key);
syncResults.add(makeSyncResult(masterRecord, null, null));
@@ -230,19 +230,19 @@
int length = updatedRecords.length();
for (int i = 0; i < length; i++) {
- final RecordKey key = new RecordKey(updatedRecords.get(i).getId(),
+ final EntityProxyId key = new EntityProxyId(updatedRecords.get(i).getId(),
requestFactory.getSchema(updatedRecords.get(i).getSchema()),
RequestFactoryJsonImpl.NOT_FUTURE);
Map<String, String> violations = violationsMap.get(key.id);
assert violations != null;
// post change events if no violations.
if (violations == NULL_VIOLATIONS) {
- requestFactory.postChangeEvent(RecordJsoImpl.create(key.id, 1,
+ requestFactory.postChangeEvent(ProxyJsoImpl.create(key.id, 1,
key.schema), WriteOperation.UPDATE);
}
- RecordJsoImpl masterRecord = master.records.get(key);
- RecordJsoImpl value = updates.get(key);
+ ProxyJsoImpl masterRecord = master.records.get(key);
+ ProxyJsoImpl value = updates.get(key);
if (masterRecord != null && value != null) {
// no support for partial updates.
masterRecord.merge(value);
@@ -265,12 +265,12 @@
return !operations.isEmpty();
}
- public <V> void set(Property<V> property, Record record, V value) {
+ public <V> void set(Property<V> property, EntityProxy record, V value) {
checkArgumentsAndState(record, "set");
- RecordImpl recordImpl = (RecordImpl) record;
- RecordKey recordKey = new RecordKey(recordImpl);
+ ProxyImpl recordImpl = (ProxyImpl) record;
+ EntityProxyId recordKey = new EntityProxyId(recordImpl);
- RecordJsoImpl rawMasterRecord = master.records.get(recordKey);
+ ProxyJsoImpl rawMasterRecord = master.records.get(recordKey);
WriteOperation priorOperation = operations.get(recordKey);
if (rawMasterRecord == null && priorOperation == null) {
operations.put(recordKey, WriteOperation.CREATE);
@@ -282,7 +282,7 @@
return;
}
- RecordJsoImpl priorRecord = null;
+ ProxyJsoImpl priorRecord = null;
switch (priorOperation) {
case CREATE:
// nothing to do here.
@@ -338,10 +338,10 @@
/**
* returns true if a new change record has been added.
*/
- private <V> boolean addNewChangeRecord(RecordKey recordKey,
- RecordImpl recordImpl, Property<V> property, V value) {
- RecordJsoImpl rawMasterRecord = master.records.get(recordKey);
- RecordJsoImpl changeRecord = newChangeRecord(recordImpl);
+ private <V> boolean addNewChangeRecord(EntityProxyId recordKey,
+ ProxyImpl recordImpl, Property<V> property, V value) {
+ ProxyJsoImpl rawMasterRecord = master.records.get(recordKey);
+ ProxyJsoImpl changeRecord = newChangeRecord(recordImpl);
if (isRealChange(property, value, rawMasterRecord)) {
changeRecord.set(property, value);
updates.put(recordKey, changeRecord);
@@ -351,28 +351,28 @@
return false;
}
- private void checkArgumentsAndState(Record record, String methodName) {
+ private void checkArgumentsAndState(EntityProxy record, String methodName) {
if (used) {
throw new IllegalStateException(methodName
+ " can only be called on an un-used DeltaValueStore");
}
- if (!(record instanceof RecordImpl)) {
+ if (!(record instanceof ProxyImpl)) {
throw new IllegalArgumentException(record + " + must be an instance of "
- + RecordImpl.class);
+ + ProxyImpl.class);
}
}
private String getJsonForOperation(WriteOperation writeOperation) {
assert (writeOperation == WriteOperation.CREATE || writeOperation == WriteOperation.UPDATE);
- Map<RecordKey, RecordJsoImpl> recordsMap = getRecordsMap(writeOperation);
+ Map<EntityProxyId, ProxyJsoImpl> recordsMap = getRecordsMap(writeOperation);
if (recordsMap.size() == 0) {
return "";
}
StringBuffer requestData = new StringBuffer("\"" + writeOperation.name()
+ "\":[");
boolean first = true;
- for (Map.Entry<RecordKey, RecordJsoImpl> entry : recordsMap.entrySet()) {
- RecordJsoImpl impl = entry.getValue();
+ for (Map.Entry<EntityProxyId, ProxyJsoImpl> entry : recordsMap.entrySet()) {
+ ProxyJsoImpl impl = entry.getValue();
if (first) {
first = false;
} else {
@@ -387,7 +387,7 @@
return requestData.toString();
}
- private Map<RecordKey, RecordJsoImpl> getRecordsMap(
+ private Map<EntityProxyId, ProxyJsoImpl> getRecordsMap(
WriteOperation writeOperation) {
switch (writeOperation) {
case CREATE:
@@ -419,8 +419,8 @@
}
private <V> boolean isRealChange(Property<V> property, V value,
- RecordJsoImpl rawMasterRecord) {
- RecordJsoImpl masterRecord = null;
+ ProxyJsoImpl rawMasterRecord) {
+ ProxyJsoImpl masterRecord = null;
if (rawMasterRecord == null) {
return true;
@@ -445,18 +445,18 @@
return true;
}
- private SyncResultImpl makeSyncResult(RecordJsoImpl jso,
+ private SyncResultImpl makeSyncResult(ProxyJsoImpl jso,
Map<String, String> violations, Long futureId) {
return new SyncResultImpl(jso.getSchema().create(jso), violations, futureId);
}
- private RecordJsoImpl newChangeRecord(RecordImpl fromRecord) {
- return RecordJsoImpl.emptyCopy(fromRecord.asJso());
+ private ProxyJsoImpl newChangeRecord(ProxyImpl fromRecord) {
+ return ProxyJsoImpl.emptyCopy(fromRecord.asJso());
}
- private void processToRemove(Set<RecordKey> toRemove,
+ private void processToRemove(Set<EntityProxyId> toRemove,
WriteOperation writeOperation) {
- for (RecordKey recordKey : toRemove) {
+ for (EntityProxyId recordKey : toRemove) {
operations.remove(recordKey);
if (writeOperation == WriteOperation.CREATE) {
creates.remove(recordKey);
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RecordKey.java b/user/src/com/google/gwt/requestfactory/client/impl/EntityProxyId.java
similarity index 87%
rename from user/src/com/google/gwt/requestfactory/client/impl/RecordKey.java
rename to user/src/com/google/gwt/requestfactory/client/impl/EntityProxyId.java
index 402cdd1..b01f613 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RecordKey.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/EntityProxyId.java
@@ -21,22 +21,22 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * The key used to store {@link com.google.gwt.requestfactory.shared.Record Record}s.
+ * The key used to store {@link com.google.gwt.requestfactory.shared.EntityProxy Proxy}.
*/
-class RecordKey {
- final RecordSchema<?> schema;
+class EntityProxyId {
+ final ProxySchema<?> schema;
final Long id;
final boolean isFuture;
- RecordKey(RecordImpl record) {
+ EntityProxyId(ProxyImpl record) {
this(record.getId(), record.getSchema(), record.isFuture());
}
- RecordKey(RecordJsoImpl record, boolean isFuture) {
+ EntityProxyId(ProxyJsoImpl record, boolean isFuture) {
this(record.getId(), record.getSchema(), isFuture);
}
- protected RecordKey(Long id, RecordSchema<?> schema, boolean isFuture) {
+ protected EntityProxyId(Long id, ProxySchema<?> schema, boolean isFuture) {
assert id != null;
assert schema != null;
@@ -56,7 +56,7 @@
if (getClass() != obj.getClass()) {
return false;
}
- RecordKey other = (RecordKey) obj;
+ EntityProxyId other = (EntityProxyId) obj;
if (isFuture != other.isFuture) {
return false;
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RecordImpl.java b/user/src/com/google/gwt/requestfactory/client/impl/ProxyImpl.java
similarity index 77%
rename from user/src/com/google/gwt/requestfactory/client/impl/RecordImpl.java
rename to user/src/com/google/gwt/requestfactory/client/impl/ProxyImpl.java
index ae059c4c..418f330 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RecordImpl.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/ProxyImpl.java
@@ -17,7 +17,7 @@
import com.google.gwt.requestfactory.shared.Property;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
/**
* <p>
@@ -25,25 +25,32 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Base class for implementations of {@link Record}. It wraps a
- * {@link RecordJsoImpl} that does all the actual work. This class has little
+ * Base class for implementations of {@link EntityProxy}. It wraps a
+ * {@link ProxyJsoImpl} that does all the actual work. This class has little
* reason to exist except to allow client code to make instanceof checks, and to
* work around issue 4859 (JSOs cannot have abstract superclasses). If the issue
* is fixed it might be worth abandoning the instanceof capability, needs
* thinking.
*/
-public class RecordImpl implements Record {
- private final RecordJsoImpl jso;
+public class ProxyImpl implements EntityProxy {
+
+ protected static String getUniqueId(Long id, boolean isFuture,
+ ProxySchema<?> schema) {
+ return id + "-" + (isFuture ? "IS" : "NO") + "-" + schema.getToken();
+ }
+
+ private final ProxyJsoImpl jso;
private final boolean isFuture;
+
private DeltaValueStoreJsonImpl deltaValueStore;
- protected RecordImpl(RecordJsoImpl record, boolean isFuture) {
+ protected ProxyImpl(ProxyJsoImpl record, boolean isFuture) {
this.jso = record;
this.isFuture = isFuture;
deltaValueStore = null;
}
- public RecordJsoImpl asJso() {
+ public ProxyJsoImpl asJso() {
return jso;
}
@@ -59,13 +66,12 @@
return jso.getRef(property);
}
- public RecordSchema<?> getSchema() {
+ public ProxySchema<?> getSchema() {
return jso.getSchema();
}
public String getUniqueId() {
- return jso.getId() + "-" + (isFuture ? "IS" : "NO") + "-"
- + getSchema().getToken();
+ return getUniqueId(jso.getId(), isFuture, jso.getSchema());
}
public Integer getVersion() {
@@ -83,7 +89,7 @@
return isFuture;
}
- public <V> void set(Property<V> property, RecordImpl record, V value) {
+ public <V> void set(Property<V> property, ProxyImpl record, V value) {
if (deltaValueStore == null) {
throw new UnsupportedOperationException(
"Setter methods can't be called before calling edit()");
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RecordJsoImpl.java b/user/src/com/google/gwt/requestfactory/client/impl/ProxyJsoImpl.java
similarity index 88%
rename from user/src/com/google/gwt/requestfactory/client/impl/RecordJsoImpl.java
rename to user/src/com/google/gwt/requestfactory/client/impl/ProxyJsoImpl.java
index 075c25e..e27c254 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RecordJsoImpl.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/ProxyJsoImpl.java
@@ -21,7 +21,7 @@
import com.google.gwt.requestfactory.shared.EnumProperty;
import com.google.gwt.requestfactory.shared.Property;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -30,10 +30,10 @@
/**
* <p> <span style="color:red">Experimental API: This class is still under rapid
* development, and is very likely to be deleted. Use it at your own risk.
- * </span> </p> JSO implementation of {@link Record}, used to back subclasses of
- * {@link RecordImpl}.
+ * </span> </p> JSO implementation of {@link EntityProxy}, used to back subclasses of
+ * {@link ProxyImpl}.
*/
-public class RecordJsoImpl extends JavaScriptObject implements Record {
+public class ProxyJsoImpl extends JavaScriptObject implements EntityProxy {
/**
* JSO to hold result and related objects.
@@ -47,11 +47,11 @@
return this.exception || null;
}-*/;
- public final native JsArray<RecordJsoImpl> getListResult() /*-{
+ public final native JsArray<ProxyJsoImpl> getListResult() /*-{
return this.result;
}-*/;
- public final native RecordJsoImpl getRecordResult() /*-{
+ public final native ProxyJsoImpl getRecordResult() /*-{
return this.result;
}-*/;
@@ -67,31 +67,31 @@
}-*/;
}
- public static native JsArray<RecordJsoImpl> arrayFromJson(String json) /*-{
+ public static native JsArray<ProxyJsoImpl> arrayFromJson(String json) /*-{
return eval(json);
}-*/;
- public static RecordJsoImpl create(Long id, Integer version,
- final RecordSchema<?> schema) {
- RecordJsoImpl copy = create();
+ public static ProxyJsoImpl create(Long id, Integer version,
+ final ProxySchema<?> schema) {
+ ProxyJsoImpl copy = create();
copy.setSchema(schema);
- copy.set(Record.id, id);
- copy.set(Record.version, version);
+ copy.set(EntityProxy.id, id);
+ copy.set(EntityProxy.version, version);
return copy;
}
- public static RecordJsoImpl emptyCopy(RecordJsoImpl jso) {
- Long id = jso.get(Record.id);
- Integer version = jso.get(Record.version);
- final RecordSchema<?> schema = jso.getSchema();
+ public static ProxyJsoImpl emptyCopy(ProxyJsoImpl jso) {
+ Long id = jso.get(EntityProxy.id);
+ Integer version = jso.get(EntityProxy.version);
+ final ProxySchema<?> schema = jso.getSchema();
- RecordJsoImpl copy = create(id, version, schema);
+ ProxyJsoImpl copy = create(id, version, schema);
copy.setRequestFactory(jso.getRequestFactory());
copy.setValueStore(jso.getValueStore());
return copy;
}
- public static native RecordJsoImpl fromJson(String json) /*-{
+ public static native ProxyJsoImpl fromJson(String json) /*-{
// TODO: clean this
eval("xyz=" + json);
return xyz;
@@ -105,11 +105,11 @@
/* Made protected, for testing */
- protected static native RecordJsoImpl create() /*-{
+ protected static native ProxyJsoImpl create() /*-{
return {};
}-*/;
- protected RecordJsoImpl() {
+ protected ProxyJsoImpl() {
}
public final native void delete(String name)/*-{
@@ -221,7 +221,7 @@
return this['__rf'];
}-*/;
- public final native RecordSchema<?> getSchema() /*-{
+ public final native ProxySchema<?> getSchema() /*-{
return this['__key'];
}-*/;
@@ -243,7 +243,7 @@
public final boolean isEmpty() {
for (Property<?> property : getSchema().allProperties()) {
- if ((property != Record.id) && (property != Record.version) && (isDefined(
+ if ((property != EntityProxy.id) && (property != EntityProxy.version) && (isDefined(
property.getName()))) {
return false;
}
@@ -258,7 +258,7 @@
return this[name] == null;
}-*/;
- public final boolean merge(RecordJsoImpl from) {
+ public final boolean merge(ProxyJsoImpl from) {
assert getSchema() == from.getSchema();
boolean changed = false;
@@ -318,8 +318,8 @@
return;
}
- if (value instanceof RecordImpl) {
- setString(property.getName(), ((RecordImpl) value).getUniqueId());
+ if (value instanceof ProxyImpl) {
+ setString(property.getName(), ((ProxyImpl) value).getUniqueId());
return;
}
@@ -332,7 +332,7 @@
this['__rf'] = requestFactory;
}-*/;
- public final native void setSchema(RecordSchema<?> schema) /*-{
+ public final native void setSchema(ProxySchema<?> schema) /*-{
this['__key'] = schema;
}-*/;
@@ -376,7 +376,7 @@
}-*/;
private native boolean copyPropertyIfDifferent(String name,
- RecordJsoImpl from) /*-{
+ ProxyJsoImpl from) /*-{
if (this[name] == from[name]) {
return false;
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RecordSchema.java b/user/src/com/google/gwt/requestfactory/client/impl/ProxySchema.java
similarity index 68%
rename from user/src/com/google/gwt/requestfactory/client/impl/RecordSchema.java
rename to user/src/com/google/gwt/requestfactory/client/impl/ProxySchema.java
index 8e10fab..3f7f225 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RecordSchema.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/ProxySchema.java
@@ -16,8 +16,8 @@
package com.google.gwt.requestfactory.client.impl;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
import java.util.Collections;
@@ -30,15 +30,15 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Used by {@link Record} implementations generated by
+ * Used by {@link EntityProxy} implementations generated by
* {@link com.google.gwt.requestfactory.rebind.RequestFactoryGenerator
* RequestFactoryGenerator}. Defines the set of properties for a class of
- * Record, and serves as a factory for these records and their
- * {@link RecordChangedEvent}s.
+ * Proxy, and serves as a factory for these proxies and their
+ * {@link EntityProxyChangedEvent}s.
*
- * @param <R> the type of the Records this schema describes
+ * @param <P> the type of the Proxies this schema describes
*/
-public abstract class RecordSchema<R extends Record> {
+public abstract class ProxySchema<P extends EntityProxy> {
private final String token;
@@ -46,28 +46,28 @@
{
Set<Property<?>> set = new HashSet<Property<?>>();
- set.add(Record.id);
- set.add(Record.version);
+ set.add(EntityProxy.id);
+ set.add(EntityProxy.version);
allProperties = Collections.unmodifiableSet(set);
}
- public RecordSchema(String token) {
+ public ProxySchema(String token) {
this.token = token;
}
public Set<Property<?>> allProperties() {
return allProperties;
}
- public final R create(RecordJsoImpl jso) {
+ public final P create(ProxyJsoImpl jso) {
return create(jso, RequestFactoryJsonImpl.NOT_FUTURE);
}
- public abstract R create(RecordJsoImpl jso, boolean isFuture);
+ public abstract P create(ProxyJsoImpl jso, boolean isFuture);
- public abstract RecordChangedEvent<?, ?> createChangeEvent(Record record,
+ public abstract EntityProxyChangedEvent<?, ?> createChangeEvent(EntityProxy record,
WriteOperation writeOperation);
- public abstract Class<? extends Record> getProxyClass();
+ public abstract Class<? extends EntityProxy> getProxyClass();
public String getToken() {
return token;
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RecordToTypeMap.java b/user/src/com/google/gwt/requestfactory/client/impl/ProxyToTypeMap.java
similarity index 77%
rename from user/src/com/google/gwt/requestfactory/client/impl/RecordToTypeMap.java
rename to user/src/com/google/gwt/requestfactory/client/impl/ProxyToTypeMap.java
index 7e96054..0723abd 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RecordToTypeMap.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/ProxyToTypeMap.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.requestfactory.client.impl;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
/**
* <p>
@@ -24,10 +24,10 @@
* </span>
* </p>
* A class that can map the "TOKEN" generated by a JPA-savvy tool in every
- * Record class to its internal "type" representation.
+ * Proxy class to its internal "type" representation.
*/
-public interface RecordToTypeMap {
+public interface ProxyToTypeMap {
String getClassToken(Class<?> recordClass);
- <R extends Record> RecordSchema<R> getType(Class<R> recordClass);
- RecordSchema<? extends Record> getType(String token);
+ <R extends EntityProxy> ProxySchema<R> getType(Class<R> recordClass);
+ ProxySchema<? extends EntityProxy> getType(String token);
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java b/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java
index f2a2994..f7e9648 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java
@@ -21,7 +21,7 @@
import com.google.gwt.editor.client.impl.AbstractEditorDelegate;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
@@ -37,7 +37,7 @@
* @param <P> the type of Proxy
* @param <E> the type of Editor
*/
-public abstract class RequestFactoryEditorDelegate<P extends Record, E extends Editor<P>>
+public abstract class RequestFactoryEditorDelegate<P extends EntityProxy, E extends Editor<P>>
extends AbstractEditorDelegate<P, E> implements EditorDelegate<P> {
protected RequestFactory factory;
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java b/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
index e9c60e7..eb21762 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
@@ -23,7 +23,7 @@
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.requestfactory.client.RequestFactoryLogHandler;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestEvent;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
@@ -64,10 +64,10 @@
private EventBus eventBus;
- public <R extends Record> R create(Class<R> token,
- RecordToTypeMap recordToTypeMap) {
+ public <R extends EntityProxy> R create(Class<R> token,
+ ProxyToTypeMap recordToTypeMap) {
- RecordSchema<R> schema = recordToTypeMap.getType(token);
+ ProxySchema<R> schema = recordToTypeMap.getType(token);
if (schema == null) {
throw new IllegalArgumentException("Unknown proxy type: " + token);
}
@@ -118,11 +118,11 @@
}
}
- public Class<? extends Record> getClass(Record proxy) {
- return ((RecordImpl) proxy).getSchema().getProxyClass();
+ public Class<? extends EntityProxy> getClass(EntityProxy proxy) {
+ return ((ProxyImpl) proxy).getSchema().getProxyClass();
}
- public abstract RecordSchema<?> getSchema(String token);
+ public abstract ProxySchema<?> getSchema(String token);
/**
* @param eventBus
@@ -135,23 +135,23 @@
logger.fine("Successfully initialized RequestFactory");
}
- protected Class<? extends Record> getClass(String token,
- RecordToTypeMap recordToTypeMap) {
+ protected Class<? extends EntityProxy> getClass(String token,
+ ProxyToTypeMap recordToTypeMap) {
String[] bits = token.split("-");
- RecordSchema<? extends Record> schema = recordToTypeMap.getType(bits[0]);
+ ProxySchema<? extends EntityProxy> schema = recordToTypeMap.getType(bits[0]);
if (schema == null) {
return null;
}
return schema.getProxyClass();
}
- protected Record getProxy(String token, RecordToTypeMap recordToTypeMap) {
+ protected EntityProxy getProxy(String token, ProxyToTypeMap recordToTypeMap) {
String[] bits = token.split("-");
if (bits.length < 2 || bits.length > 3) {
return null;
}
- RecordSchema<? extends Record> schema = recordToTypeMap.getType(bits[0]);
+ ProxySchema<? extends EntityProxy> schema = recordToTypeMap.getType(bits[0]);
if (schema == null) {
return null;
}
@@ -167,13 +167,13 @@
return null;
}
- return schema.create(RecordJsoImpl.create(id, -1, schema));
+ return schema.create(ProxyJsoImpl.create(id, -1, schema));
}
- protected String getToken(Record record, RecordToTypeMap recordToTypeMap) {
- Class<? extends Record> proxyClass = ((RecordImpl) record).getSchema().getProxyClass();
+ protected String getToken(EntityProxy record, ProxyToTypeMap recordToTypeMap) {
+ Class<? extends EntityProxy> proxyClass = ((ProxyImpl) record).getSchema().getProxyClass();
String rtn = recordToTypeMap.getClassToken(proxyClass) + "-";
- if (((RecordImpl) record).isFuture()) {
+ if (((ProxyImpl) record).isFuture()) {
rtn += "0-FUTURE";
} else {
rtn += record.getId();
@@ -185,20 +185,20 @@
return valueStore;
}
- void postChangeEvent(RecordJsoImpl newJsoRecord, WriteOperation op) {
+ void postChangeEvent(ProxyJsoImpl newJsoRecord, WriteOperation op) {
/*
* Ensure event receivers aren't accidentally using cached info by making an
* unpopulated copy of the record.
*/
- newJsoRecord = RecordJsoImpl.emptyCopy(newJsoRecord);
- Record javaRecord = newJsoRecord.getSchema().create(newJsoRecord);
+ newJsoRecord = ProxyJsoImpl.emptyCopy(newJsoRecord);
+ EntityProxy javaRecord = newJsoRecord.getSchema().create(newJsoRecord);
eventBus.fireEvent(newJsoRecord.getSchema().createChangeEvent(javaRecord,
op));
}
- private <R extends Record> R createFuture(RecordSchema<R> schema) {
+ private <R extends EntityProxy> R createFuture(ProxySchema<R> schema) {
Long futureId = ++currentFutureId;
- RecordJsoImpl newRecord = RecordJsoImpl.create(futureId, INITIAL_VERSION,
+ ProxyJsoImpl newRecord = ProxyJsoImpl.create(futureId, INITIAL_VERSION,
schema);
return schema.create(newRecord, IS_FUTURE);
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java b/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java
index e3034f9..e3d2b15 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java
@@ -16,7 +16,7 @@
package com.google.gwt.requestfactory.client.impl;
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.WriteOperation;
import java.util.HashMap;
@@ -32,38 +32,38 @@
public class ValueStoreJsonImpl {
// package protected fields for use by DeltaValueStoreJsonImpl
- final Map<RecordKey, RecordJsoImpl> records = new HashMap<RecordKey, RecordJsoImpl>();
+ final Map<EntityProxyId, ProxyJsoImpl> records = new HashMap<EntityProxyId, ProxyJsoImpl>();
- public Record getRecordBySchemaAndId(RecordSchema<?> schema,
+ public EntityProxy getRecordBySchemaAndId(ProxySchema<?> schema,
Long id) {
if (id == null) {
return null;
}
// TODO: pass isFuture to this method from decoding ID string
- RecordKey key = new RecordKey(id, schema, false);
+ EntityProxyId key = new EntityProxyId(id, schema, false);
return schema.create(records.get(key));
}
- public void setRecord(RecordJsoImpl newRecord,
+ public void setProxy(ProxyJsoImpl newRecord,
RequestFactoryJsonImpl requestFactory) {
setRecordInList(newRecord, 0, null, requestFactory);
}
- public void setRecords(JsArray<RecordJsoImpl> newRecords,
+ public void setRecords(JsArray<ProxyJsoImpl> newRecords,
RequestFactoryJsonImpl requestFactory) {
for (int i = 0, l = newRecords.length(); i < l; i++) {
- RecordJsoImpl newRecord = newRecords.get(i);
+ ProxyJsoImpl newRecord = newRecords.get(i);
setRecordInList(newRecord, i, newRecords, requestFactory);
}
}
- private void setRecordInList(RecordJsoImpl newJsoRecord, int i,
- JsArray<RecordJsoImpl> array, RequestFactoryJsonImpl requestFactory) {
- RecordKey recordKey = new RecordKey(newJsoRecord, RequestFactoryJsonImpl.NOT_FUTURE);
+ private void setRecordInList(ProxyJsoImpl newJsoRecord, int i,
+ JsArray<ProxyJsoImpl> array, RequestFactoryJsonImpl requestFactory) {
+ EntityProxyId recordKey = new EntityProxyId(newJsoRecord, RequestFactoryJsonImpl.NOT_FUTURE);
newJsoRecord.setValueStore(this);
newJsoRecord.setRequestFactory(requestFactory);
- RecordJsoImpl oldRecord = records.get(recordKey);
+ ProxyJsoImpl oldRecord = records.get(recordKey);
if (oldRecord == null) {
records.put(recordKey, newJsoRecord);
// TODO: need to fire a create event.
diff --git a/user/src/com/google/gwt/requestfactory/client/testing/MockRequestFactoryEditorDriver.java b/user/src/com/google/gwt/requestfactory/client/testing/MockRequestFactoryEditorDriver.java
index c152834..1c85897 100644
--- a/user/src/com/google/gwt/requestfactory/client/testing/MockRequestFactoryEditorDriver.java
+++ b/user/src/com/google/gwt/requestfactory/client/testing/MockRequestFactoryEditorDriver.java
@@ -18,7 +18,7 @@
import com.google.gwt.editor.client.Editor;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.requestfactory.client.RequestFactoryEditorDriver;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
@@ -29,7 +29,7 @@
* @param <P> the Proxy type being edited
* @param <E> the Editor type
*/
-public class MockRequestFactoryEditorDriver<P extends Record, E extends Editor<P>>
+public class MockRequestFactoryEditorDriver<P extends EntityProxy, E extends Editor<P>>
implements RequestFactoryEditorDriver<P, E> {
private static final String[] EMPTY_STRING = new String[0];
diff --git a/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java b/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
index 799e903..1ae6bce 100644
--- a/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
+++ b/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
@@ -44,18 +44,18 @@
import com.google.gwt.requestfactory.client.impl.AbstractShortRequest;
import com.google.gwt.requestfactory.client.impl.AbstractStringRequest;
import com.google.gwt.requestfactory.client.impl.AbstractVoidRequest;
-import com.google.gwt.requestfactory.client.impl.RecordImpl;
-import com.google.gwt.requestfactory.client.impl.RecordJsoImpl;
-import com.google.gwt.requestfactory.client.impl.RecordSchema;
-import com.google.gwt.requestfactory.client.impl.RecordToTypeMap;
+import com.google.gwt.requestfactory.client.impl.ProxyImpl;
+import com.google.gwt.requestfactory.client.impl.ProxyJsoImpl;
+import com.google.gwt.requestfactory.client.impl.ProxySchema;
+import com.google.gwt.requestfactory.client.impl.ProxyToTypeMap;
import com.google.gwt.requestfactory.client.impl.RequestFactoryJsonImpl;
import com.google.gwt.requestfactory.server.ReflectionBasedOperationRegistry;
import com.google.gwt.requestfactory.shared.Property;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
-import com.google.gwt.requestfactory.shared.RecordListRequest;
-import com.google.gwt.requestfactory.shared.RecordRequest;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
+import com.google.gwt.requestfactory.shared.ProxyListRequest;
+import com.google.gwt.requestfactory.shared.ProxyRequest;
import com.google.gwt.requestfactory.shared.RequestData;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.WriteOperation;
@@ -81,7 +81,7 @@
*/
public class RequestFactoryGenerator extends Generator {
- private final Set<JClassType> generatedRecordTypes
+ private final Set<JClassType> generatedProxyTypes
= new HashSet<JClassType>();
@Override
@@ -132,38 +132,38 @@
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
- private void ensureRecordType(TreeLogger logger,
+ private void ensureProxyType(TreeLogger logger,
GeneratorContext generatorContext, String packageName,
- JClassType publicRecordType) throws UnableToCompleteException {
+ JClassType publicProxyType) throws UnableToCompleteException {
TypeOracle typeOracle = generatorContext.getTypeOracle();
- if (!publicRecordType.isAssignableTo(typeOracle.findType(Record.class.getName()))) {
+ if (!publicProxyType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
return;
}
- if (generatedRecordTypes.contains(publicRecordType)) {
+ if (generatedProxyTypes.contains(publicProxyType)) {
return;
}
- String recordImplTypeName = publicRecordType.getName() + "Impl";
+ String proxyImplTypeName = publicProxyType.getName() + "Impl";
PrintWriter pw = generatorContext.tryCreate(logger, packageName,
- recordImplTypeName);
+ proxyImplTypeName);
Set<JClassType> transitiveDeps = new LinkedHashSet<JClassType>();
if (pw != null) {
logger = logger.branch(TreeLogger.DEBUG, "Generating "
- + publicRecordType.getName());
+ + publicProxyType.getName());
ClassSourceFileComposerFactory f = new ClassSourceFileComposerFactory(
- packageName, recordImplTypeName);
+ packageName, proxyImplTypeName);
- String eventTypeName = publicRecordType.getName() + "Changed";
+ String eventTypeName = publicProxyType.getName() + "Changed";
JClassType eventType = typeOracle.findType(packageName, eventTypeName);
if (eventType == null) {
logger.log(TreeLogger.ERROR,
String.format("Cannot find %s implementation %s.%s",
- RecordChangedEvent.class.getName(), packageName,
+ EntityProxyChangedEvent.class.getName(), packageName,
eventTypeName));
throw new UnableToCompleteException();
}
@@ -172,10 +172,10 @@
f.addImport(AbstractJsonObjectRequest.class.getName());
f.addImport(RequestFactoryJsonImpl.class.getName());
f.addImport(Property.class.getName());
- f.addImport(Record.class.getName());
- f.addImport(RecordImpl.class.getName());
- f.addImport(RecordJsoImpl.class.getName());
- f.addImport(RecordSchema.class.getName());
+ f.addImport(EntityProxy.class.getName());
+ f.addImport(ProxyImpl.class.getName());
+ f.addImport(ProxyJsoImpl.class.getName());
+ f.addImport(ProxySchema.class.getName());
f.addImport(WriteOperation.class.getName().replace("$", "."));
f.addImport(Collections.class.getName());
@@ -184,35 +184,35 @@
f.addImport(Map.class.getName());
f.addImport(HashMap.class.getName());
- f.setSuperclass(RecordImpl.class.getSimpleName());
- f.addImplementedInterface(publicRecordType.getName());
+ f.setSuperclass(ProxyImpl.class.getSimpleName());
+ f.addImplementedInterface(publicProxyType.getName());
SourceWriter sw = f.createSourceWriter(generatorContext, pw);
sw.println();
- JClassType propertyType = printSchema(typeOracle, publicRecordType,
- recordImplTypeName, eventType, sw);
+ JClassType propertyType = printSchema(typeOracle, publicProxyType,
+ proxyImplTypeName, eventType, sw);
sw.println();
- String simpleImplName = publicRecordType.getSimpleSourceName() + "Impl";
- printRequestImplClass(sw, publicRecordType, simpleImplName, true);
- printRequestImplClass(sw, publicRecordType, simpleImplName, false);
+ String simpleImplName = publicProxyType.getSimpleSourceName() + "Impl";
+ printRequestImplClass(sw, publicProxyType, simpleImplName, true);
+ printRequestImplClass(sw, publicProxyType, simpleImplName, false);
sw.println();
sw.println(String.format(
- "public static final RecordSchema<%s> SCHEMA = new MySchema();",
- recordImplTypeName));
+ "public static final ProxySchema<%s> SCHEMA = new MySchema();",
+ proxyImplTypeName));
sw.println();
- sw.println(String.format("private %s(RecordJsoImpl jso, boolean isFuture) {",
- recordImplTypeName));
+ sw.println(String.format("private %s(ProxyJsoImpl jso, boolean isFuture) {",
+ proxyImplTypeName));
sw.indent();
sw.println("super(jso, isFuture);");
sw.outdent();
sw.println("}");
// getter methods
- for (JField field : publicRecordType.getFields()) {
+ for (JField field : publicProxyType.getFields()) {
JType fieldType = field.getType();
if (propertyType.getErasedType() == fieldType.getErasedType()) {
JParameterizedType parameterized = fieldType.isParameterized();
@@ -234,14 +234,14 @@
* Because a Proxy A may relate to B which relates to C, we need to
* ensure transitively.
*/
- if (isRecordType(typeOracle, returnType)) {
+ if (isProxyType(typeOracle, returnType)) {
transitiveDeps.add(returnType);
}
}
}
// setter methods
- for (JField field : publicRecordType.getFields()) {
+ for (JField field : publicProxyType.getFields()) {
JType fieldType = field.getType();
if (propertyType.getErasedType() == fieldType.getErasedType()) {
JParameterizedType parameterized = fieldType.isParameterized();
@@ -268,10 +268,10 @@
generatorContext.commit(logger, pw);
}
- generatedRecordTypes.add(publicRecordType);
+ generatedProxyTypes.add(publicProxyType);
// ensure generatation of transitive dependencies
for (JClassType type : transitiveDeps) {
- ensureRecordType(logger, generatorContext, type.getPackage().getName(),
+ ensureProxyType(logger, generatorContext, type.getPackage().getName(),
type);
}
}
@@ -290,9 +290,9 @@
f.addImport(HandlerManager.class.getName());
f.addImport(RequestFactoryJsonImpl.class.getName());
f.addImport(interfaceType.getQualifiedSourceName());
- f.addImport(RecordToTypeMap.class.getName());
- f.addImport(Record.class.getName());
- f.addImport(RecordSchema.class.getName());
+ f.addImport(ProxyToTypeMap.class.getName());
+ f.addImport(EntityProxy.class.getName());
+ f.addImport(ProxySchema.class.getName());
f.addImplementedInterface(interfaceType.getName());
f.setSuperclass(RequestFactoryJsonImpl.class.getSimpleName());
@@ -337,38 +337,38 @@
e.printStackTrace();
}
- JClassType recordToTypeInterface = generatorContext.getTypeOracle().findType(RecordToTypeMap.class.getName());
+ JClassType proxyToTypeInterface = generatorContext.getTypeOracle().findType(ProxyToTypeMap.class.getName());
// TODO: note, this seems like a bug. What if you have 2 RequestFactories?
- String recordToTypeMapName = recordToTypeInterface.getName() + "Impl";
+ String proxyToTypeMapName = proxyToTypeInterface.getName() + "Impl";
// write create(Class)
- sw.println("public " + Record.class.getName() + " create(Class token) {");
+ sw.println("public " + EntityProxy.class.getName() + " create(Class token) {");
sw.indent();
- sw.println("return create(token, new " + recordToTypeMapName + "());");
+ sw.println("return create(token, new " + proxyToTypeMapName + "());");
sw.outdent();
sw.println("}");
sw.println();
// write getClass(String)
- sw.println("public Class<? extends " + Record.class.getName() + "> getClass(String token) {");
+ sw.println("public Class<? extends " + EntityProxy.class.getName() + "> getClass(String token) {");
sw.indent();
- sw.println("return getClass(token, new " + recordToTypeMapName + "());");
+ sw.println("return getClass(token, new " + proxyToTypeMapName + "());");
sw.outdent();
sw.println("}");
sw.println();
// write getProxy(String)
- sw.println("public " + Record.class.getName() + " getProxy(String token) {");
+ sw.println("public " + EntityProxy.class.getName() + " getProxy(String token) {");
sw.indent();
- sw.println("return getProxy(token, new " + recordToTypeMapName + "());");
+ sw.println("return getProxy(token, new " + proxyToTypeMapName + "());");
sw.outdent();
sw.println("}");
sw.println();
- // write getToken(Record)
- sw.println("public String getToken(Record record) {");
+ // write getToken(Proxy)
+ sw.println("public String getToken(EntityProxy proxy) {");
sw.indent();
- sw.println("return getToken(record, new " + recordToTypeMapName + "());");
+ sw.println("return getToken(proxy, new " + proxyToTypeMapName + "());");
sw.outdent();
sw.println("}");
sw.println();
@@ -376,15 +376,15 @@
// write getToken(Class)
sw.println("public String getToken(Class clazz) {");
sw.indent();
- sw.println("return new " + recordToTypeMapName + "().getClassToken(clazz);");
+ sw.println("return new " + proxyToTypeMapName + "().getClassToken(clazz);");
sw.outdent();
sw.println("}");
sw.println();
sw.println(
- "public RecordSchema<? extends Record> getSchema(String schemaToken) {");
+ "public ProxySchema<? extends EntityProxy> getSchema(String schemaToken) {");
sw.indent();
- sw.println("return new " + recordToTypeMapName + "().getType(schemaToken);");
+ sw.println("return new " + proxyToTypeMapName + "().getType(schemaToken);");
sw.outdent();
sw.println("}");
@@ -419,15 +419,15 @@
// generate the mapping type implementation
PrintWriter pw = generatorContext.tryCreate(logger, packageName,
- recordToTypeMapName);
+ proxyToTypeMapName);
if (pw != null) {
- generateRecordToTypeMap(logger, generatorContext, pw,
- recordToTypeInterface, packageName, recordToTypeMapName);
+ generateProxyToTypeMap(logger, generatorContext, pw,
+ proxyToTypeInterface, packageName, proxyToTypeMapName);
}
generatorContext.commit(logger, out);
}
- private void generateRecordToTypeMap(TreeLogger logger,
+ private void generateProxyToTypeMap(TreeLogger logger,
GeneratorContext generatorContext, PrintWriter out,
JClassType interfaceType, String packageName, String implName) {
logger = logger.branch(TreeLogger.DEBUG,
@@ -437,8 +437,8 @@
ClassSourceFileComposerFactory f = new ClassSourceFileComposerFactory(
packageName, implName);
f.addImport(interfaceType.getQualifiedSourceName());
- f.addImport(Record.class.getName());
- f.addImport(RecordSchema.class.getName());
+ f.addImport(EntityProxy.class.getName());
+ f.addImport(ProxySchema.class.getName());
f.addImport(interfaceType.getQualifiedSourceName());
f.addImplementedInterface(interfaceType.getName());
@@ -447,28 +447,28 @@
SourceWriter sw = f.createSourceWriter(generatorContext, out);
sw.println();
- sw.println("public <R extends Record> RecordSchema<R> getType(Class<R> recordClass) {");
+ sw.println("public <R extends EntityProxy> ProxySchema<R> getType(Class<R> proxyClass) {");
sw.indent();
- for (JClassType publicRecordType : generatedRecordTypes) {
- String qualifiedSourceName = publicRecordType.getQualifiedSourceName();
- sw.println("if (recordClass == " + qualifiedSourceName + ".class) {");
+ for (JClassType publicProxyType : generatedProxyTypes) {
+ String qualifiedSourceName = publicProxyType.getQualifiedSourceName();
+ sw.println("if (proxyClass == " + qualifiedSourceName + ".class) {");
sw.indent();
- sw.println("return (RecordSchema<R>) " + qualifiedSourceName + "Impl.SCHEMA;");
+ sw.println("return (ProxySchema<R>) " + qualifiedSourceName + "Impl.SCHEMA;");
sw.outdent();
sw.println("}");
}
sw.println(
- "throw new IllegalArgumentException(\"Unknown recordClass \" + recordClass);");
+ "throw new IllegalArgumentException(\"Unknown proxyClass \" + proxyClass);");
sw.indent();
sw.outdent();
sw.outdent();
sw.println("}");
- sw.println("public RecordSchema<? extends Record> getType(String token) {");
+ sw.println("public ProxySchema<? extends EntityProxy> getType(String token) {");
sw.indent();
sw.println("String[] bits = token.split(\"-\");");
- for (JClassType publicRecordType : generatedRecordTypes) {
- String qualifiedSourceName = publicRecordType.getQualifiedSourceName();
+ for (JClassType publicProxyType : generatedProxyTypes) {
+ String qualifiedSourceName = publicProxyType.getQualifiedSourceName();
sw.println("if (bits[0].equals(\"" + qualifiedSourceName + "\")) {");
sw.indent();
sw.println("return " + qualifiedSourceName + "Impl.SCHEMA;");
@@ -479,18 +479,18 @@
sw.outdent();
sw.println("}");
- sw.println("public String getClassToken(Class<?> recordClass) {");
+ sw.println("public String getClassToken(Class<?> proxyClass) {");
sw.indent();
- for (JClassType publicRecordType : generatedRecordTypes) {
- String qualifiedSourceName = publicRecordType.getQualifiedSourceName();
- sw.println("if (recordClass == " + qualifiedSourceName + ".class) {");
+ for (JClassType publicProxyType : generatedProxyTypes) {
+ String qualifiedSourceName = publicProxyType.getQualifiedSourceName();
+ sw.println("if (proxyClass == " + qualifiedSourceName + ".class) {");
sw.indent();
sw.println("return \"" + qualifiedSourceName + "\";");
sw.outdent();
sw.println("}");
}
sw.println(
- "throw new IllegalArgumentException(\"Unknown recordClass \" + recordClass);");
+ "throw new IllegalArgumentException(\"Unknown proxyClass \" + proxyClass);");
sw.indent();
sw.outdent();
sw.outdent();
@@ -537,7 +537,7 @@
for (JMethod method : selectorInterface.getOverridableMethods()) {
JClassType returnType = method.getReturnType().isParameterized().getTypeArgs()[0];
- ensureRecordType(logger, generatorContext,
+ ensureProxyType(logger, generatorContext,
returnType.getPackage().getName(), returnType);
String operationName = selectorInterface.getQualifiedBinaryName()
@@ -549,9 +549,9 @@
TypeOracle typeOracle = generatorContext.getTypeOracle();
String enumArgument = "";
// TODO: refactor this into some kind of extensible map lookup
- if (isRecordListRequest(typeOracle, requestType)) {
+ if (isProxyListRequest(typeOracle, requestType)) {
requestClassName = asInnerImplClass("ListRequestImpl", returnType);
- } else if (isRecordRequest(typeOracle, requestType)) {
+ } else if (isProxyRequest(typeOracle, requestType)) {
requestClassName = asInnerImplClass("ObjectRequestImpl", returnType);
} else if (isStringRequest(typeOracle, requestType)) {
requestClassName = AbstractStringRequest.class.getName();
@@ -661,7 +661,7 @@
classType = params.getTypeArgs()[0];
}
if (classType != null
- && classType.isAssignableTo(typeOracle.findType(Record.class.getName()))) {
+ && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
sb.append("((" + classType.getQualifiedBinaryName() + "Impl" + ")");
}
sb.append(parameter.getName());
@@ -672,7 +672,7 @@
sb.append(".get()");
}
if (classType != null
- && classType.isAssignableTo(typeOracle.findType(Record.class.getName()))) {
+ && classType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()))) {
sb.append(").getUniqueId()");
}
}
@@ -730,18 +730,18 @@
return requestType.isParameterized().getTypeArgs()[0].isAssignableTo(typeOracle.findType(Long.class.getName()));
}
- private boolean isRecordListRequest(TypeOracle typeOracle,
+ private boolean isProxyListRequest(TypeOracle typeOracle,
JClassType requestType) {
- return requestType.isAssignableTo(typeOracle.findType(RecordListRequest.class.getName()));
+ return requestType.isAssignableTo(typeOracle.findType(ProxyListRequest.class.getName()));
}
- private boolean isRecordRequest(TypeOracle typeOracle,
+ private boolean isProxyRequest(TypeOracle typeOracle,
JClassType requestType) {
- return requestType.isAssignableTo(typeOracle.findType(RecordRequest.class.getName()));
+ return requestType.isAssignableTo(typeOracle.findType(ProxyRequest.class.getName()));
}
- private boolean isRecordType(TypeOracle typeOracle, JClassType requestType) {
- return requestType.isAssignableTo(typeOracle.findType(Record.class.getName()));
+ private boolean isProxyType(TypeOracle typeOracle, JClassType requestType) {
+ return requestType.isAssignableTo(typeOracle.findType(EntityProxy.class.getName()));
}
private boolean isShortRequest(TypeOracle typeOracle,
@@ -795,8 +795,8 @@
/**
* @param typeOracle
- * @param publicRecordType
- * @param recordImplTypeName
+ * @param publicProxyType
+ * @param proxyImplTypeName
* @param eventType
* @param sw
* @return
@@ -804,11 +804,11 @@
*/
private JClassType printSchema(TypeOracle typeOracle,
- JClassType publicRecordType, String recordImplTypeName,
+ JClassType publicProxyType, String proxyImplTypeName,
JClassType eventType, SourceWriter sw) {
sw.println(
- String.format("public static class MySchema extends RecordSchema<%s> {",
- recordImplTypeName));
+ String.format("public static class MySchema extends ProxySchema<%s> {",
+ proxyImplTypeName));
sw.indent();
sw.println("private final Set<Property<?>> allProperties;");
@@ -825,7 +825,7 @@
throw new RuntimeException(e);
}
- for (JField field : publicRecordType.getFields()) {
+ for (JField field : publicProxyType.getFields()) {
if (propertyType.getErasedType() == field.getType().getErasedType()) {
sw.println(String.format("set.add(%s);", field.getName()));
}
@@ -845,34 +845,34 @@
sw.println();
sw.println("public MySchema() {");
sw.indent();
- sw.println("super(\"" + publicRecordType.getQualifiedSourceName() + "\");");
+ sw.println("super(\"" + publicProxyType.getQualifiedSourceName() + "\");");
sw.outdent();
sw.println("}");
sw.println();
sw.println("@Override");
- sw.println(String.format("public %s create(RecordJsoImpl jso, boolean isFuture) {",
- recordImplTypeName));
+ sw.println(String.format("public %s create(ProxyJsoImpl jso, boolean isFuture) {",
+ proxyImplTypeName));
sw.indent();
- sw.println(String.format("return new %s(jso, isFuture);", recordImplTypeName));
+ sw.println(String.format("return new %s(jso, isFuture);", proxyImplTypeName));
sw.outdent();
sw.println("}");
sw.println();
sw.println("@Override");
sw.println(String.format(
- "public %s createChangeEvent(Record record, WriteOperation writeOperation) {",
+ "public %s createChangeEvent(EntityProxy proxy, WriteOperation writeOperation) {",
eventType.getName()));
sw.indent();
- sw.println(String.format("return new %s((%s) record, writeOperation);",
- eventType.getName(), publicRecordType.getName()));
+ sw.println(String.format("return new %s((%s) proxy, writeOperation);",
+ eventType.getName(), publicProxyType.getName()));
sw.outdent();
sw.println("}");
sw.println();
sw.println("public Class getProxyClass() {");
sw.indent();
- sw.println("return " + publicRecordType.getQualifiedSourceName() + ".class;"
+ sw.println("return " + publicProxyType.getQualifiedSourceName() + ".class;"
+ " // special field");
sw.outdent();
sw.println("}");
diff --git a/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java b/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
index b16c70f..2291f0d 100644
--- a/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
+++ b/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
@@ -15,10 +15,10 @@
*/
package com.google.gwt.requestfactory.server;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Property;
import com.google.gwt.requestfactory.shared.PropertyReference;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestData;
import com.google.gwt.requestfactory.shared.WriteOperation;
@@ -81,9 +81,9 @@
private final boolean isFuture;
// TODO: update for non-long id?
private final long id;
- private final Class<? extends Record> record;
+ private final Class<? extends EntityProxy> record;
- EntityKey(long id, boolean isFuture, Class<? extends Record> record) {
+ EntityKey(long id, boolean isFuture, Class<? extends EntityProxy> record) {
this.id = id;
this.isFuture = isFuture;
assert record != null;
@@ -145,7 +145,7 @@
private Map<EntityKey, SerializedEntity> beforeDataMap = new HashMap<EntityKey, SerializedEntity>();
private Map<EntityKey, EntityData> afterDvsDataMap = new HashMap<EntityKey, EntityData>();
- public Collection<Property<?>> allProperties(Class<? extends Record> clazz) {
+ public Collection<Property<?>> allProperties(Class<? extends EntityProxy> clazz) {
Set<Property<?>> rtn = new HashSet<Property<?>>();
for (Field f : clazz.getFields()) {
if (Modifier.isStatic(f.getModifiers())
@@ -262,14 +262,14 @@
if (Date.class == parameterType) {
return new Date(Long.parseLong(parameterValue));
}
- if (Record.class.isAssignableFrom(parameterType)) {
+ if (EntityProxy.class.isAssignableFrom(parameterType)) {
/* TODO: 1. Don't resolve in this step, just get EntityKey. May need to
* use DVS.
*
* 2. Merge the following and the object resolution code in getEntityKey.
* 3. Update the involvedKeys set.
*/
- DataTransferObject service = parameterType.getAnnotation(DataTransferObject.class);
+ ProxyFor service = parameterType.getAnnotation(ProxyFor.class);
if (service != null) {
Class<?> sClass = service.value();
EntityKey entityKey = getEntityKey(parameterValue.toString());
@@ -337,7 +337,7 @@
String methodName = getMethodNameFromPropertyName(propertyName, "get");
Method method = entityElement.getClass().getMethod(methodName);
Object returnValue = method.invoke(entityElement);
- if (returnValue != null && Record.class.isAssignableFrom(propertyType)) {
+ if (returnValue != null && EntityProxy.class.isAssignableFrom(propertyType)) {
Method idMethod = returnValue.getClass().getMethod("getId");
Long id = (Long) idMethod.invoke(returnValue);
@@ -400,7 +400,7 @@
}
} else {
Object propertyValue = null;
- if (Record.class.isAssignableFrom(dtoType)) {
+ if (EntityProxy.class.isAssignableFrom(dtoType)) {
EntityKey propKey = getEntityKey(recordObject.getString(key));
Object cacheValue = cachedEntityLookup.get(propKey);
if (cachedEntityLookup.containsKey(propKey)) {
@@ -449,8 +449,8 @@
@SuppressWarnings("unchecked")
public Class<Object> getEntityFromRecordAnnotation(
- Class<? extends Record> record) {
- DataTransferObject dtoAnn = record.getAnnotation(DataTransferObject.class);
+ Class<? extends EntityProxy> record) {
+ ProxyFor dtoAnn = record.getAnnotation(ProxyFor.class);
if (dtoAnn != null) {
return (Class<Object>) dtoAnn.value();
}
@@ -480,7 +480,7 @@
* @return the JSONArray
*/
public JSONArray getJsonArray(List<?> resultList,
- Class<? extends Record> entityKeyClass)
+ Class<? extends EntityProxy> entityKeyClass)
throws IllegalArgumentException, SecurityException,
IllegalAccessException, JSONException, NoSuchMethodException,
InvocationTargetException {
@@ -496,7 +496,7 @@
}
public JSONObject getJsonObject(Object entityElement,
- Class<? extends Record> entityKeyClass, RequestProperty propertyContext)
+ Class<? extends EntityProxy> entityKeyClass, RequestProperty propertyContext)
throws JSONException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
JSONObject jsonObject = new JSONObject();
@@ -589,7 +589,7 @@
* Returns the property fields (name => type) for a record.
*/
public Map<String, Class<?>> getPropertiesFromRecord(
- Class<? extends Record> record) throws SecurityException,
+ Class<? extends EntityProxy> record) throws SecurityException,
IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Map<String, Class<?>> properties = new HashMap<String, Class<?>>();
for (Field f : record.getFields()) {
@@ -612,12 +612,12 @@
}
@SuppressWarnings("unchecked")
- public Class<Record> getRecordFromClassToken(String recordToken) {
+ public Class<EntityProxy> getRecordFromClassToken(String recordToken) {
try {
Class<?> clazz = Class.forName(recordToken, false,
getClass().getClassLoader());
- if (Record.class.isAssignableFrom(clazz)) {
- return (Class<Record>) clazz;
+ if (EntityProxy.class.isAssignableFrom(clazz)) {
+ return (Class<EntityProxy>) clazz;
}
throw new SecurityException(
"Attempt to access non-record class " + recordToken);
@@ -778,7 +778,7 @@
}
private void addRelatedObject(String keyRef, Object returnValue,
- Class<? extends Record> propertyType, RequestProperty propertyContext)
+ Class<? extends EntityProxy> propertyType, RequestProperty propertyContext)
throws JSONException, IllegalAccessException, NoSuchMethodException,
InvocationTargetException {
@@ -787,8 +787,8 @@
}
@SuppressWarnings("unchecked")
- private Class<? extends Record> castToRecordClass(Class<?> propertyType) {
- return (Class<? extends Record>) propertyType;
+ private Class<? extends EntityProxy> castToRecordClass(Class<?> propertyType) {
+ return (Class<? extends EntityProxy>) propertyType;
}
/**
@@ -863,7 +863,7 @@
"There cannot be more than one record token");
}
JSONObject recordObject = recordWithSchema.getJSONObject(recordToken);
- Class<? extends Record> record = getRecordFromClassToken(recordToken);
+ Class<? extends EntityProxy> record = getRecordFromClassToken(recordToken);
EntityKey entityKey = new EntityKey(recordObject.getLong("id"),
(writeOperation == WriteOperation.CREATE), record);
involvedKeys.add(entityKey);
@@ -962,7 +962,7 @@
getRecordFromClassToken(parts[2]));
}
- private String getSchemaAndId(Class<? extends Record> record, Object newId) {
+ private String getSchemaAndId(Class<? extends EntityProxy> record, Object newId) {
return record.getName() + "-" + newId;
}
@@ -1066,7 +1066,7 @@
*/
private boolean requestedProperty(Property<?> p,
RequestProperty propertyContext) {
- if (Record.class.isAssignableFrom(p.getType())) {
+ if (EntityProxy.class.isAssignableFrom(p.getType())) {
return propertyContext.hasProperty(p.getName());
}
@@ -1080,7 +1080,7 @@
* TODO: clean up the copy-paste from getJSONObject.
*/
private JSONObject serializeEntity(Object entityInstance,
- Class<? extends Record> recordClass) throws SecurityException,
+ Class<? extends EntityProxy> recordClass) throws SecurityException,
NoSuchMethodException, IllegalArgumentException, IllegalAccessException,
InvocationTargetException, JSONException {
if (entityInstance == null) {
@@ -1094,7 +1094,7 @@
Object returnValue = method.invoke(entityInstance);
Object propertyValue;
- if (returnValue != null && Record.class.isAssignableFrom(p.getType())) {
+ if (returnValue != null && EntityProxy.class.isAssignableFrom(p.getType())) {
Method idMethod = returnValue.getClass().getMethod("getId");
Long id = (Long) idMethod.invoke(returnValue);
@@ -1113,7 +1113,7 @@
throws IllegalAccessException, JSONException, NoSuchMethodException,
InvocationTargetException {
JSONArray jsonArray = getJsonArray((List<?>) result,
- (Class<? extends Record>) operation.getReturnType());
+ (Class<? extends EntityProxy>) operation.getReturnType());
return jsonArray;
}
@@ -1122,7 +1122,7 @@
throws JSONException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
JSONObject jsonObject = getJsonObject(result,
- (Class<? extends Record>) operation.getReturnType(), propertyRefs);
+ (Class<? extends EntityProxy>) operation.getReturnType(), propertyRefs);
return jsonObject;
}
diff --git a/user/src/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistry.java b/user/src/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistry.java
index 5bc6adb..5d95dd7 100644
--- a/user/src/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistry.java
+++ b/user/src/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistry.java
@@ -15,9 +15,9 @@
*/
package com.google.gwt.requestfactory.server;
-import com.google.gwt.requestfactory.shared.DataTransferObject;
+import com.google.gwt.requestfactory.shared.ProxyFor;
import com.google.gwt.requestfactory.shared.Instance;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.requestfactory.shared.Service;
@@ -82,9 +82,9 @@
domainMethod.getGenericReturnType());
Class<?> requestReturnType = getReturnTypeFromParameter(requestMethod,
requestMethod.getGenericReturnType());
- if (Record.class.isAssignableFrom(requestReturnType)) {
- DataTransferObject annotation =
- requestReturnType.getAnnotation(DataTransferObject.class);
+ if (EntityProxy.class.isAssignableFrom(requestReturnType)) {
+ ProxyFor annotation =
+ requestReturnType.getAnnotation(ProxyFor.class);
if (annotation != null) {
Class<?> dtoClass = annotation.value();
if (!dtoClass.equals(domainReturnType)) {
diff --git a/user/src/com/google/gwt/requestfactory/shared/Record.java b/user/src/com/google/gwt/requestfactory/shared/EntityProxy.java
similarity index 87%
rename from user/src/com/google/gwt/requestfactory/shared/Record.java
rename to user/src/com/google/gwt/requestfactory/shared/EntityProxy.java
index c0c11d5..131b411 100644
--- a/user/src/com/google/gwt/requestfactory/shared/Record.java
+++ b/user/src/com/google/gwt/requestfactory/shared/EntityProxy.java
@@ -23,14 +23,14 @@
* </p>
* A proxy for a server-side domain object.
*/
-public interface Record {
+public interface EntityProxy {
Property<Long> id = new Property<Long>("id", Long.class);
Property<Integer> version = new Property<Integer>("version", Integer.class);
/**
- * Get this record's value for the given property. Behavior is undefined if
- * the record has no such property, or if the property has never been set. It
+ * Get this proxy's value for the given property. Behavior is undefined if
+ * the proxy has no such property, or if the property has never been set. It
* is unusual to call this method directly. Rather it is expected to be called
* by bean-style getter methods provided by implementing classes.
*
@@ -41,7 +41,7 @@
<V> V get(Property<V> property);
/**
- * @return the id of this Record
+ * @return the id of this Proxy.
*/
Long getId();
@@ -56,7 +56,7 @@
<V> PropertyReference<V> getRef(Property<V> property);
/**
- * @return the version of this Record
+ * @return the version of this Proxy.
*/
Integer getVersion();
}
diff --git a/user/src/com/google/gwt/requestfactory/shared/RecordChangedEvent.java b/user/src/com/google/gwt/requestfactory/shared/EntityProxyChangedEvent.java
similarity index 74%
rename from user/src/com/google/gwt/requestfactory/shared/RecordChangedEvent.java
rename to user/src/com/google/gwt/requestfactory/shared/EntityProxyChangedEvent.java
index b0a6714..d0e0d1b 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RecordChangedEvent.java
+++ b/user/src/com/google/gwt/requestfactory/shared/EntityProxyChangedEvent.java
@@ -24,36 +24,36 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Abstract base class for an event announcing changes to a {@link Record}.
+ * Abstract base class for an event announcing changes to a {@link EntityProxy}.
* <p>
- * Note that this event includes an unpopulated copy of the changed record
+ * Note that this event includes an unpopulated copy of the changed proxy
* — all properties are undefined except it's id. That is, the event
* includes only enough information for receivers to issue requests to get
- * themselves fresh copies of the record.
+ * themselves fresh copies of the proxy.
* <p>
- * TODO: rather than an empty record, consider using a string token
+ * TODO: rather than an empty proxy, consider using a string token
*
- * @param <R> the type of the record
+ * @param <P> the type of the proxy
* @param <H> the type of event handler
*/
// TODO Should this provide a collection of changed values rather than fire for
// each one?
-public abstract class RecordChangedEvent<R extends Record, H extends EventHandler>
+public abstract class EntityProxyChangedEvent<P extends EntityProxy, H extends EventHandler>
extends GwtEvent<H> {
- R record;
+ P proxy;
WriteOperation writeOperation;
- public RecordChangedEvent(R record, WriteOperation writeOperation) {
- this.record = record;
+ public EntityProxyChangedEvent(P proxy, WriteOperation writeOperation) {
+ this.proxy = proxy;
this.writeOperation = writeOperation;
}
/**
- * @return an unpopulated copy of the changed record — all properties
- * are undefined except it's id
+ * @return an unpopulated copy of the changed proxy — all properties
+ * are undefined except its id
*/
- public R getRecord() {
- return record;
+ public P getProxy() {
+ return proxy;
}
public WriteOperation getWriteOperation() {
diff --git a/user/src/com/google/gwt/requestfactory/shared/EnumProperty.java b/user/src/com/google/gwt/requestfactory/shared/EnumProperty.java
index fb4f062..ae356e8 100644
--- a/user/src/com/google/gwt/requestfactory/shared/EnumProperty.java
+++ b/user/src/com/google/gwt/requestfactory/shared/EnumProperty.java
@@ -21,7 +21,7 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Defines a property of a {@link com.google.gwt.requestfactory.shared.Record}.
+ * Defines a property of a {@link com.google.gwt.requestfactory.shared.EntityProxy}.
*
* @param <V> the type of the property's value
*/
diff --git a/user/src/com/google/gwt/requestfactory/shared/Property.java b/user/src/com/google/gwt/requestfactory/shared/Property.java
index 41406cf..ebcf906 100644
--- a/user/src/com/google/gwt/requestfactory/shared/Property.java
+++ b/user/src/com/google/gwt/requestfactory/shared/Property.java
@@ -21,7 +21,7 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * Defines a property of a {@link Record}.
+ * Defines a property of a {@link EntityProxy}.
*
* @param <V> the type of the property's value
*/
diff --git a/user/src/com/google/gwt/requestfactory/shared/PropertyReference.java b/user/src/com/google/gwt/requestfactory/shared/PropertyReference.java
index 5944632..ab09f66 100644
--- a/user/src/com/google/gwt/requestfactory/shared/PropertyReference.java
+++ b/user/src/com/google/gwt/requestfactory/shared/PropertyReference.java
@@ -26,10 +26,10 @@
* @param <V> Value type
*/
public class PropertyReference<V> {
- private final Record record;
+ private final EntityProxy record;
private final Property<V> property;
- public PropertyReference(Record record, Property<V> property) {
+ public PropertyReference(EntityProxy record, Property<V> property) {
assert null != record;
assert null != property;
diff --git a/user/src/com/google/gwt/requestfactory/shared/DataTransferObject.java b/user/src/com/google/gwt/requestfactory/shared/ProxyFor.java
similarity index 96%
rename from user/src/com/google/gwt/requestfactory/shared/DataTransferObject.java
rename to user/src/com/google/gwt/requestfactory/shared/ProxyFor.java
index 21c505e..f118ac8 100644
--- a/user/src/com/google/gwt/requestfactory/shared/DataTransferObject.java
+++ b/user/src/com/google/gwt/requestfactory/shared/ProxyFor.java
@@ -28,7 +28,7 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
-public @interface DataTransferObject {
+public @interface ProxyFor {
Class<?> value();
}
diff --git a/user/src/com/google/gwt/requestfactory/shared/RecordListRequest.java b/user/src/com/google/gwt/requestfactory/shared/ProxyListRequest.java
similarity index 79%
rename from user/src/com/google/gwt/requestfactory/shared/RecordListRequest.java
rename to user/src/com/google/gwt/requestfactory/shared/ProxyListRequest.java
index 5a88626..77f2c55 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RecordListRequest.java
+++ b/user/src/com/google/gwt/requestfactory/shared/ProxyListRequest.java
@@ -25,15 +25,15 @@
* </span> </p> Implemented by RequestObjects for service methods that return
* lists of records.
*
- * @param <R> The type held by the returned list
+ * @param <P> The type held by the returned list
*/
-public interface RecordListRequest<R extends Record>
- extends RequestObject<List<R>> {
+public interface ProxyListRequest<P extends EntityProxy>
+ extends RequestObject<List<P>> {
- RecordListRequest<R> with(String... propertyRefs);
+ ProxyListRequest<P> with(String... propertyRefs);
/**
* @deprecated use {@link #with(String...)} instead.
*/
- RecordListRequest<R> forProperties(Collection<Property<?>> properties);
+ ProxyListRequest<P> forProperties(Collection<Property<?>> properties);
}
diff --git a/user/src/com/google/gwt/requestfactory/shared/RecordRequest.java b/user/src/com/google/gwt/requestfactory/shared/ProxyRequest.java
similarity index 80%
rename from user/src/com/google/gwt/requestfactory/shared/RecordRequest.java
rename to user/src/com/google/gwt/requestfactory/shared/ProxyRequest.java
index 0b5530b..af81e42 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RecordRequest.java
+++ b/user/src/com/google/gwt/requestfactory/shared/ProxyRequest.java
@@ -24,19 +24,19 @@
* development, and is very likely to be deleted. Use it at your own risk.
* </span>
* </p>
- * A Request that returns specific properties for one or more {@link Record}
+ * A Request that returns specific properties for one or more {@link EntityProxy}
* instances.
*
- * @param <R> return type
+ * @param <P> return type
*/
-public interface RecordRequest<R extends Record> extends
- RequestObject<R> {
+public interface ProxyRequest<P extends EntityProxy> extends
+ RequestObject<P> {
- RecordRequest<R> with(String... propertyRefs);
+ ProxyRequest<P> with(String... propertyRefs);
/**
* @deprecated use {@link #with(String...)} instead.
*/
- RecordRequest<R> forProperties(Collection<Property<?>> properties);
+ ProxyRequest<P> forProperties(Collection<Property<?>> properties);
}
diff --git a/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java b/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java
index bb407a8..cf58c18 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java
+++ b/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java
@@ -31,7 +31,7 @@
// TODO: this must be configurable
String URL = "gwtRequest";
- <R extends Record> R create(Class<R> token);
+ <R extends EntityProxy> R create(Class<R> token);
/**
* Return the class object which may be used to create new instances of the
@@ -39,21 +39,21 @@
* metadata system, calls to the proxy's getClass() method will not serve this
* purpose.
*/
- Class<? extends Record> getClass(Record proxy);
+ Class<? extends EntityProxy> getClass(EntityProxy proxy);
/**
* Return the class object which may be used to create new instances of the
* type of this token, via {@link #create}. The token may represent either a
- * proxy instance (see {@link #getToken(Record)) or a proxy class (see
+ * proxy instance (see {@link #getToken(Proxy)) or a proxy class (see
*
* @link #getToken(Class)}).
*/
- Class<? extends Record> getClass(String token);
+ Class<? extends EntityProxy> getClass(String token);
/**
* Return the appropriate proxy, which may have only its id attribute set.
*/
- Record getProxy(String token);
+ EntityProxy getProxy(String token);
/**
* Get a {@link com.google.gwt.user.client.History} compatible token that
@@ -62,16 +62,16 @@
*
* @return a {@link com.google.gwt.user.client.History} compatible token
*/
- String getToken(Class<?> clazz);
+ String getToken(Class<? extends EntityProxy> clazz);
/**
* Get a {@link com.google.gwt.user.client.History} compatible token that
* represents the given proxy. It can be processed by
- * {@link #getClass(String)} and {@link #getClass(Record)}.
+ * {@link #getClass(String)} and {@link #getClass(EntityProxy)}.
*
* @return a {@link com.google.gwt.user.client.History} compatible token
*/
- String getToken(Record proxy);
+ String getToken(EntityProxy proxy);
/**
* Start this request factory.
diff --git a/user/src/com/google/gwt/requestfactory/shared/RequestObject.java b/user/src/com/google/gwt/requestfactory/shared/RequestObject.java
index 8402048..79d9a57 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RequestObject.java
+++ b/user/src/com/google/gwt/requestfactory/shared/RequestObject.java
@@ -33,7 +33,7 @@
*/
void clearUsed();
- <P extends Record> P edit(P record);
+ <P extends EntityProxy> P edit(P record);
void fire(Receiver<T> receiver);
diff --git a/user/src/com/google/gwt/requestfactory/shared/SyncResult.java b/user/src/com/google/gwt/requestfactory/shared/SyncResult.java
index 334376d..858d6a8 100644
--- a/user/src/com/google/gwt/requestfactory/shared/SyncResult.java
+++ b/user/src/com/google/gwt/requestfactory/shared/SyncResult.java
@@ -32,7 +32,7 @@
// TODO: futureId isn't working out so well, leaving soon
Long getFutureId();
- Record getRecord();
+ EntityProxy getProxy();
Map<String, String> getViolations();
}
diff --git a/user/src/com/google/gwt/requestfactory/shared/UserInformationRecord.java b/user/src/com/google/gwt/requestfactory/shared/UserInformationProxy.java
similarity index 92%
rename from user/src/com/google/gwt/requestfactory/shared/UserInformationRecord.java
rename to user/src/com/google/gwt/requestfactory/shared/UserInformationProxy.java
index b4d8c63..8a27bb7 100644
--- a/user/src/com/google/gwt/requestfactory/shared/UserInformationRecord.java
+++ b/user/src/com/google/gwt/requestfactory/shared/UserInformationProxy.java
@@ -21,8 +21,8 @@
/**
* "API Generated" DTO interface based on {@link UserInformation}.
*/
-@DataTransferObject(UserInformation.class)
-public interface UserInformationRecord extends Record {
+@ProxyFor(UserInformation.class)
+public interface UserInformationProxy extends EntityProxy {
Property<String> email =
new Property<String>("email", "Email", String.class);
Property<String> loginUrl =
diff --git a/user/src/com/google/gwt/requestfactory/shared/UserInformationRecordChanged.java b/user/src/com/google/gwt/requestfactory/shared/UserInformationProxyChanged.java
similarity index 79%
rename from user/src/com/google/gwt/requestfactory/shared/UserInformationRecordChanged.java
rename to user/src/com/google/gwt/requestfactory/shared/UserInformationProxyChanged.java
index 71b8a70..457b5ef 100644
--- a/user/src/com/google/gwt/requestfactory/shared/UserInformationRecordChanged.java
+++ b/user/src/com/google/gwt/requestfactory/shared/UserInformationProxyChanged.java
@@ -20,22 +20,22 @@
import com.google.gwt.event.shared.GwtEvent;
/**
- * "API Generated" event posted when the values of a {@link UserInformationRecord}
+ * "API Generated" event posted when the values of a {@link UserInformationProxy}
* change.
*/
-public class UserInformationRecordChanged extends
- RecordChangedEvent<UserInformationRecord, UserInformationRecordChanged.Handler> {
+public class UserInformationProxyChanged extends
+ EntityProxyChangedEvent<UserInformationProxy, UserInformationProxyChanged.Handler> {
/**
* Implemented by handlers of this type of event.
*/
public interface Handler extends EventHandler {
- void onUserInformationChanged(UserInformationRecordChanged event);
+ void onUserInformationChanged(UserInformationProxyChanged event);
}
public static final Type<Handler> TYPE = new Type<Handler>();
- public UserInformationRecordChanged(UserInformationRecord record, WriteOperation writeOperation) {
+ public UserInformationProxyChanged(UserInformationProxy record, WriteOperation writeOperation) {
super(record, writeOperation);
}
diff --git a/user/src/com/google/gwt/requestfactory/shared/UserInformationRequest.java b/user/src/com/google/gwt/requestfactory/shared/UserInformationRequest.java
index 8417ae5..2333632 100644
--- a/user/src/com/google/gwt/requestfactory/shared/UserInformationRequest.java
+++ b/user/src/com/google/gwt/requestfactory/shared/UserInformationRequest.java
@@ -25,6 +25,6 @@
@Service(UserInformation.class)
public interface UserInformationRequest {
- RecordRequest<UserInformationRecord> getCurrentUserInformation(String redirectUrl);
+ ProxyRequest<UserInformationProxy> getCurrentUserInformation(String redirectUrl);
}
diff --git a/user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java b/user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java
index 3156b1a..b5d4f06 100644
--- a/user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java
+++ b/user/test/com/google/gwt/editor/rebind/model/EditorModelTest.java
@@ -33,8 +33,8 @@
import com.google.gwt.editor.client.adapters.StringEditor;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.requestfactory.client.RequestFactoryEditorDriver;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
import com.google.gwt.requestfactory.shared.RequestFactory;
import com.google.gwt.requestfactory.shared.RequestObject;
import com.google.gwt.user.client.TakesValue;
@@ -336,8 +336,8 @@
protected CharSequence getContent() {
StringBuilder code = new StringBuilder();
code.append("package t;\n");
- code.append("import " + Record.class.getName() + ";\n");
- code.append("interface AddressProxy extends Record {\n");
+ code.append("import " + EntityProxy.class.getName() + ";\n");
+ code.append("interface AddressProxy extends EntityProxy {\n");
code.append("String getCity();\n");
code.append("void setCity(String city);\n");
code.append("String getStreet();\n");
@@ -363,8 +363,8 @@
protected CharSequence getContent() {
StringBuilder code = new StringBuilder();
code.append("package t;\n");
- code.append("import " + Record.class.getName() + ";\n");
- code.append("interface CompositeProxy extends Record {\n");
+ code.append("import " + EntityProxy.class.getName() + ";\n");
+ code.append("interface CompositeProxy extends EntityProxy {\n");
code.append("AddressProxy getAddress();\n");
code.append("PersonProxy getPerson();\n");
code.append("}");
@@ -400,14 +400,14 @@
StringBuilder code = new StringBuilder();
code.append("package t;\n");
code.append("import " + Editor.class.getName() + ";\n");
- code.append("import " + Record.class.getName() + ";\n");
+ code.append("import " + EntityProxy.class.getName() + ";\n");
code.append("import " + RequestFactoryEditorDriver.class.getName()
+ ";\n");
code.append("interface CyclicEditorDriver extends"
+ " RequestFactoryEditorDriver<CyclicEditorDriver.AProxy,"
+ " CyclicEditorDriver.AEditor> {\n");
- code.append(" interface AProxy extends Record { BProxy getB(); }");
- code.append(" interface BProxy extends Record { AProxy getA(); }");
+ code.append(" interface AProxy extends EntityProxy { BProxy getB(); }");
+ code.append(" interface BProxy extends EntityProxy { AProxy getA(); }");
code.append(" interface AEditor extends Editor<AProxy> {");
code.append(" BEditor bEditor();");
code.append(" }");
@@ -424,7 +424,7 @@
StringBuilder code = new StringBuilder();
code.append("package t;\n");
code.append("import " + Editor.class.getName() + ";\n");
- code.append("import " + Record.class.getName() + ";\n");
+ code.append("import " + EntityProxy.class.getName() + ";\n");
code.append("import " + RequestFactoryEditorDriver.class.getName()
+ ";\n");
code.append("import " + StringEditor.class.getName() + ";\n");
@@ -446,14 +446,14 @@
StringBuilder code = new StringBuilder();
code.append("package t;\n");
code.append("import " + Editor.class.getName() + ";\n");
- code.append("import " + Record.class.getName() + ";\n");
+ code.append("import " + EntityProxy.class.getName() + ";\n");
code.append("import " + RequestFactoryEditorDriver.class.getName()
+ ";\n");
code.append("import " + StringEditor.class.getName() + ";\n");
code.append("interface MissingGetterEditorDriver extends"
+ " RequestFactoryEditorDriver<MissingGetterEditorDriver.AProxy,"
+ " MissingGetterEditorDriver.AEditor> {\n");
- code.append(" interface AProxy extends Record {}");
+ code.append(" interface AProxy extends EntityProxy {}");
code.append(" interface AEditor extends Editor<AProxy> {");
code.append(" StringEditor missingEditor();");
code.append(" StringEditor yetAgain();");
@@ -466,8 +466,8 @@
protected CharSequence getContent() {
StringBuilder code = new StringBuilder();
code.append("package t;\n");
- code.append("import " + Record.class.getName() + ";\n");
- code.append("interface PersonProxy extends Record {\n");
+ code.append("import " + EntityProxy.class.getName() + ";\n");
+ code.append("interface PersonProxy extends EntityProxy {\n");
code.append("AddressProxy getAddress();\n");
code.append("String getName();\n");
code.append("void setName(String name);\n");
@@ -562,7 +562,7 @@
new RealJavaResource(HasText.class),
new RealJavaResource(LeafValueEditor.class),
new EmptyMockJavaResource(Property.class),
- new EmptyMockJavaResource(Record.class),
+ new EmptyMockJavaResource(EntityProxy.class),
new EmptyMockJavaResource(RequestFactory.class),
new RealJavaResource(RequestFactoryEditorDriver.class),
new EmptyMockJavaResource(RequestObject.class),
diff --git a/user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java b/user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
index 948d5d7..f2685e8 100644
--- a/user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
+++ b/user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.requestfactory;
-import com.google.gwt.requestfactory.client.impl.RecordKeyTest;
+import com.google.gwt.requestfactory.client.impl.EntityProxyIdTest;
import com.google.gwt.requestfactory.server.JsonRequestProcessorTest;
import com.google.gwt.requestfactory.server.ReflectionBasedOperationRegistryTest;
import com.google.gwt.requestfactory.server.RequestPropertyTest;
@@ -30,7 +30,7 @@
public static Test suite() {
TestSuite suite = new TestSuite(
"requestfactory package tests that require the JRE");
- suite.addTestSuite(RecordKeyTest.class);
+ suite.addTestSuite(EntityProxyIdTest.class);
suite.addTestSuite(JsonRequestProcessorTest.class);
suite.addTestSuite(ReflectionBasedOperationRegistryTest.class);
suite.addTestSuite(RequestPropertyTest.class);
diff --git a/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java b/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java
index 79d2df8..59b2738 100644
--- a/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java
+++ b/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java
@@ -19,7 +19,7 @@
import com.google.gwt.requestfactory.client.EditorTest;
import com.google.gwt.requestfactory.client.RequestFactoryTest;
import com.google.gwt.requestfactory.client.impl.DeltaValueStoreJsonImplTest;
-import com.google.gwt.requestfactory.client.impl.RecordJsoImplTest;
+import com.google.gwt.requestfactory.client.impl.ProxyJsoImplTest;
import junit.framework.Test;
@@ -31,7 +31,7 @@
GWTTestSuite suite = new GWTTestSuite(
"Test suite for requestfactory gwt code.");
suite.addTestSuite(EditorTest.class);
- suite.addTestSuite(RecordJsoImplTest.class);
+ suite.addTestSuite(ProxyJsoImplTest.class);
suite.addTestSuite(DeltaValueStoreJsonImplTest.class);
suite.addTestSuite(RequestFactoryTest.class);
return suite;
diff --git a/user/test/com/google/gwt/requestfactory/client/EditorTest.java b/user/test/com/google/gwt/requestfactory/client/EditorTest.java
index e91ccf9..213051f 100644
--- a/user/test/com/google/gwt/requestfactory/client/EditorTest.java
+++ b/user/test/com/google/gwt/requestfactory/client/EditorTest.java
@@ -22,8 +22,8 @@
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.SimpleBarRecord;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.SimpleBarProxy;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import com.google.gwt.requestfactory.shared.SimpleRequestFactory;
import com.google.gwt.requestfactory.shared.SyncResult;
@@ -35,14 +35,14 @@
*/
public class EditorTest extends GWTTestCase {
interface SimpleFooDriver extends
- RequestFactoryEditorDriver<SimpleFooRecord, SimpleFooEditor> {
+ RequestFactoryEditorDriver<SimpleFooProxy, SimpleFooEditor> {
}
- static class SimpleBarEditor implements Editor<SimpleBarRecord> {
+ static class SimpleBarEditor implements Editor<SimpleBarProxy> {
protected final StringEditor userName = StringEditor.of();
}
- static class SimpleFooEditor implements Editor<SimpleFooRecord> {
+ static class SimpleFooEditor implements Editor<SimpleFooProxy> {
/**
* Test field-based access.
*/
@@ -105,8 +105,8 @@
Arrays.asList(driver.getPaths()));
factory.simpleFooRequest().findSimpleFooById(0L).with(driver.getPaths()).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord response,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy response,
Set<SyncResult> syncResults) {
driver.edit(response,
factory.simpleFooRequest().persistAndReturnSelf(response).with(
@@ -118,9 +118,9 @@
// When there are duplicate paths, outermost editor wins
editor.barEditor().userName.setValue("ignored");
editor.barName.setValue("EditorBarTest");
- driver.<SimpleFooRecord> flush().fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord response,
+ driver.<SimpleFooProxy> flush().fire(
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy response,
Set<SyncResult> syncResults) {
assertEquals("EditorFooTest", response.getUserName());
assertEquals("EditorBarTest",
diff --git a/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java b/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
index 9ca09d1..8181d62 100644
--- a/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
+++ b/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
@@ -19,10 +19,10 @@
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.EntityProxy;
import com.google.gwt.requestfactory.shared.RequestObject;
-import com.google.gwt.requestfactory.shared.SimpleBarRecord;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.SimpleBarProxy;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import com.google.gwt.requestfactory.shared.SimpleRequestFactory;
import com.google.gwt.requestfactory.shared.SyncResult;
@@ -44,17 +44,17 @@
delayTestFinish(5000);
req.simpleBarRequest().findSimpleBarById(999L).fire(
- new Receiver<SimpleBarRecord>() {
- public void onSuccess(final SimpleBarRecord barRecord,
+ new Receiver<SimpleBarProxy>() {
+ public void onSuccess(final SimpleBarProxy barProxy,
Set<SyncResult> syncResults) {
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord fooRecord,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy fooProxy,
Set<SyncResult> syncResults) {
RequestObject<Void> updReq = req.simpleFooRequest().persist(
- fooRecord);
- fooRecord = updReq.edit(fooRecord);
- fooRecord.setBarField(barRecord);
+ fooProxy);
+ fooProxy = updReq.edit(fooProxy);
+ fooProxy.setBarField(barProxy);
updReq.fire(new Receiver<Void>() {
public void onSuccess(Void response,
Set<SyncResult> syncResults) {
@@ -76,16 +76,16 @@
req.init(hm);
delayTestFinish(5000);
- SimpleBarRecord newBar = (SimpleBarRecord) req.create(SimpleBarRecord.class);
+ SimpleBarProxy newBar = (SimpleBarProxy) req.create(SimpleBarProxy.class);
final RequestObject<Void> barReq = req.simpleBarRequest().persist(newBar);
newBar = barReq.edit(newBar);
newBar.setUserName("Amit");
- final SimpleBarRecord finalNewBar = newBar;
+ final SimpleBarProxy finalNewBar = newBar;
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord response,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy response,
Set<SyncResult> syncResults) {
RequestObject<Void> fooReq = req.simpleFooRequest().persist(
response);
@@ -94,12 +94,12 @@
fooReq.fire(new Receiver<Void>() {
public void onSuccess(Void response, Set<SyncResult> syncResults) {
req.simpleFooRequest().findSimpleFooById(999L).with(
- "barField.userName").fire(new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord finalFooRecord,
+ "barField.userName").fire(new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy finalFooProxy,
Set<SyncResult> syncResults) {
// barReq hasn't been persisted, so old value
assertEquals("FOO",
- finalFooRecord.getBarField().getUserName());
+ finalFooProxy.getBarField().getUserName());
finishTest();
}
@@ -119,27 +119,27 @@
HandlerManager hm = new HandlerManager(null);
req.init(hm);
delayTestFinish(5000);
- SimpleFooRecord newFoo = (SimpleFooRecord) req.create(SimpleFooRecord.class);
+ SimpleFooProxy newFoo = (SimpleFooProxy) req.create(SimpleFooProxy.class);
final RequestObject<Void> fooReq = req.simpleFooRequest().persist(newFoo);
newFoo = fooReq.edit(newFoo);
newFoo.setUserName("Ray");
- final SimpleFooRecord finalFoo = newFoo;
+ final SimpleFooProxy finalFoo = newFoo;
req.simpleBarRequest().findSimpleBarById(999L).fire(
- new Receiver<SimpleBarRecord>() {
- public void onSuccess(SimpleBarRecord response,
+ new Receiver<SimpleBarProxy>() {
+ public void onSuccess(SimpleBarProxy response,
Set<SyncResult> syncResults) {
finalFoo.setBarField(response);
fooReq.fire(new Receiver<Void>() {
public void onSuccess(Void response, Set<SyncResult> syncResults) {
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord finalFooRecord,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy finalFooProxy,
Set<SyncResult> syncResults) {
// newFoo hasn't been persisted, so userName is the old value.
- assertEquals("GWT", finalFooRecord.getUserName());
+ assertEquals("GWT", finalFooProxy.getUserName());
finishTest();
}
@@ -159,39 +159,39 @@
HandlerManager hm = new HandlerManager(null);
req.init(hm);
delayTestFinish(5000);
- SimpleFooRecord newFoo = (SimpleFooRecord) req.create(SimpleFooRecord.class);
- SimpleBarRecord newBar = (SimpleBarRecord) req.create(SimpleBarRecord.class);
+ SimpleFooProxy newFoo = (SimpleFooProxy) req.create(SimpleFooProxy.class);
+ SimpleBarProxy newBar = (SimpleBarProxy) req.create(SimpleBarProxy.class);
- final RequestObject<SimpleFooRecord> fooReq = req.simpleFooRequest().persistAndReturnSelf(
+ final RequestObject<SimpleFooProxy> fooReq = req.simpleFooRequest().persistAndReturnSelf(
newFoo);
newFoo = fooReq.edit(newFoo);
newFoo.setUserName("Ray");
- final RequestObject<SimpleBarRecord> barReq = req.simpleBarRequest().persistAndReturnSelf(
+ final RequestObject<SimpleBarProxy> barReq = req.simpleBarRequest().persistAndReturnSelf(
newBar);
newBar = barReq.edit(newBar);
newBar.setUserName("Amit");
- fooReq.fire(new Receiver<SimpleFooRecord>() {
- public void onSuccess(final SimpleFooRecord persistedFoo,
+ fooReq.fire(new Receiver<SimpleFooProxy>() {
+ public void onSuccess(final SimpleFooProxy persistedFoo,
Set<SyncResult> syncResult) {
- barReq.fire(new Receiver<SimpleBarRecord>() {
- public void onSuccess(final SimpleBarRecord persistedBar,
+ barReq.fire(new Receiver<SimpleBarProxy>() {
+ public void onSuccess(final SimpleBarProxy persistedBar,
Set<SyncResult> syncResults) {
assertEquals("Ray", persistedFoo.getUserName());
final RequestObject<Void> fooReq2 = req.simpleFooRequest().persist(
persistedFoo);
- SimpleFooRecord editablePersistedFoo = fooReq2.edit(persistedFoo);
+ SimpleFooProxy editablePersistedFoo = fooReq2.edit(persistedFoo);
editablePersistedFoo.setBarField(persistedBar);
fooReq2.fire(new Receiver<Void>() {
public void onSuccess(Void response, Set<SyncResult> syncResults) {
req.simpleFooRequest().findSimpleFooById(999L).with(
- "barField.userName").fire(new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord finalFooRecord,
+ "barField.userName").fire(new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy finalFooProxy,
Set<SyncResult> syncResults) {
assertEquals("Amit",
- finalFooRecord.getBarField().getUserName());
+ finalFooProxy.getBarField().getUserName());
finishTest();
}
@@ -210,14 +210,14 @@
req.init(hm);
delayTestFinish(5000);
- SimpleFooRecord rayFoo = req.create(SimpleFooRecord.class);
- final RequestObject<SimpleFooRecord> persistRay = req.simpleFooRequest().persistAndReturnSelf(
+ SimpleFooProxy rayFoo = (SimpleFooProxy) req.create(SimpleFooProxy.class);
+ final RequestObject<SimpleFooProxy> persistRay = req.simpleFooRequest().persistAndReturnSelf(
rayFoo);
rayFoo = persistRay.edit(rayFoo);
rayFoo.setUserName("Ray");
rayFoo.setFooField(rayFoo);
- persistRay.fire(new Receiver<SimpleFooRecord>() {
- public void onSuccess(final SimpleFooRecord persistedRay,
+ persistRay.fire(new Receiver<SimpleFooProxy>() {
+ public void onSuccess(final SimpleFooProxy persistedRay,
Set<SyncResult> ignored) {
finishTest();
}
@@ -230,33 +230,33 @@
req.init(hm);
delayTestFinish(5000);
- SimpleFooRecord rayFoo = req.create(SimpleFooRecord.class);
- final RequestObject<SimpleFooRecord> persistRay = req.simpleFooRequest().persistAndReturnSelf(
+ SimpleFooProxy rayFoo = (SimpleFooProxy) req.create(SimpleFooProxy.class);
+ final RequestObject<SimpleFooProxy> persistRay = req.simpleFooRequest().persistAndReturnSelf(
rayFoo);
rayFoo = persistRay.edit(rayFoo);
rayFoo.setUserName("Ray");
- persistRay.fire(new Receiver<SimpleFooRecord>() {
- public void onSuccess(final SimpleFooRecord persistedRay,
+ persistRay.fire(new Receiver<SimpleFooProxy>() {
+ public void onSuccess(final SimpleFooProxy persistedRay,
Set<SyncResult> ignored) {
- SimpleBarRecord amitBar = req.create(SimpleBarRecord.class);
- final RequestObject<SimpleBarRecord> persistAmit = req.simpleBarRequest().persistAndReturnSelf(
+ SimpleBarProxy amitBar = (SimpleBarProxy) req.create(SimpleBarProxy.class);
+ final RequestObject<SimpleBarProxy> persistAmit = req.simpleBarRequest().persistAndReturnSelf(
amitBar);
amitBar = persistAmit.edit(amitBar);
amitBar.setUserName("Amit");
- persistAmit.fire(new Receiver<SimpleBarRecord>() {
- public void onSuccess(SimpleBarRecord persistedAmit,
+ persistAmit.fire(new Receiver<SimpleBarProxy>() {
+ public void onSuccess(SimpleBarProxy persistedAmit,
Set<SyncResult> ignored) {
- final RequestObject<SimpleFooRecord> persistRelationship = req.simpleFooRequest().persistAndReturnSelf(
+ final RequestObject<SimpleFooProxy> persistRelationship = req.simpleFooRequest().persistAndReturnSelf(
persistedRay).with("barField");
- SimpleFooRecord newRec = persistRelationship.edit(persistedRay);
+ SimpleFooProxy newRec = persistRelationship.edit(persistedRay);
newRec.setBarField(persistedAmit);
- persistRelationship.fire(new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord relatedRay,
+ persistRelationship.fire(new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy relatedRay,
Set<SyncResult> ignored) {
assertEquals("Amit", relatedRay.getBarField().getUserName());
finishTest();
@@ -279,8 +279,8 @@
req.init(hm);
delayTestFinish(5000);
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord response,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy response,
Set<SyncResult> syncResult) {
assertEquals(42, (int) response.getIntId());
assertEquals("GWT", response.getUserName());
@@ -299,8 +299,8 @@
req.init(hm);
delayTestFinish(5000);
req.simpleFooRequest().findSimpleFooById(999L).with("barField").fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord response,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy response,
Set<SyncResult> syncResult) {
assertEquals(42, (int) response.getIntId());
assertEquals("GWT", response.getUserName());
@@ -313,17 +313,17 @@
});
}
- public void testRecordsAsInstanceMethodParams() {
+ public void testProxysAsInstanceMethodParams() {
final SimpleRequestFactory req = GWT.create(SimpleRequestFactory.class);
HandlerManager hm = new HandlerManager(null);
req.init(hm);
delayTestFinish(5000);
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord response,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy response,
Set<SyncResult> syncResult) {
- SimpleBarRecord bar = req.create(SimpleBarRecord.class);
+ SimpleBarProxy bar = (SimpleBarProxy) req.create(SimpleBarProxy.class);
RequestObject<String> helloReq = req.simpleFooRequest().hello(response, bar);
bar = helloReq.edit(bar);
bar.setUserName("BAR");
@@ -349,9 +349,9 @@
delayTestFinish(5000);
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
+ new Receiver<SimpleFooProxy>() {
- public void onSuccess(SimpleFooRecord newFoo,
+ public void onSuccess(SimpleFooProxy newFoo,
Set<SyncResult> syncResults) {
final RequestObject<Long> fooReq = req.simpleFooRequest().countSimpleFooWithUserNameSideEffect(
newFoo);
@@ -365,12 +365,12 @@
SyncResult syncResultArray[] = syncResults.toArray(new SyncResult[0]);
assertFalse(syncResultArray[0].hasViolations());
assertNull(syncResultArray[0].getFutureId());
- Record record = syncResultArray[0].getRecord();
- assertEquals(new Long(999L), record.getId());
+ EntityProxy proxy = syncResultArray[0].getProxy();
+ assertEquals(new Long(999L), proxy.getId());
// confirm that the instance method did have the desired sideEffect.
req.simpleFooRequest().findSimpleFooById(999L).fire(
- new Receiver<SimpleFooRecord>() {
- public void onSuccess(SimpleFooRecord finalFoo,
+ new Receiver<SimpleFooProxy>() {
+ public void onSuccess(SimpleFooProxy finalFoo,
Set<SyncResult> syncResults) {
assertEquals("Ray", finalFoo.getUserName());
finishTest();
diff --git a/user/test/com/google/gwt/requestfactory/client/SimpleRequestFactoryInstance.java b/user/test/com/google/gwt/requestfactory/client/SimpleRequestFactoryInstance.java
index b48d8d1..2cf8aae 100644
--- a/user/test/com/google/gwt/requestfactory/client/SimpleRequestFactoryInstance.java
+++ b/user/test/com/google/gwt/requestfactory/client/SimpleRequestFactoryInstance.java
@@ -16,9 +16,9 @@
package com.google.gwt.requestfactory.client;
import com.google.gwt.core.client.GWT;
-import com.google.gwt.requestfactory.client.impl.RecordImpl;
-import com.google.gwt.requestfactory.client.impl.RecordSchema;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.client.impl.ProxyImpl;
+import com.google.gwt.requestfactory.client.impl.ProxySchema;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import com.google.gwt.requestfactory.shared.SimpleRequestFactory;
/**
@@ -35,7 +35,7 @@
return factory;
}
- public static RecordSchema<?> schema() {
- return ((RecordImpl) factory().create(SimpleFooRecord.class)).getSchema();
+ public static ProxySchema<?> schema() {
+ return ((ProxyImpl) factory().create(SimpleFooProxy.class)).getSchema();
}
}
diff --git a/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java b/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java
index 6b3ca51..a43171c 100644
--- a/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java
+++ b/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java
@@ -20,8 +20,8 @@
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.requestfactory.client.SimpleRequestFactoryInstance;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import com.google.gwt.requestfactory.shared.WriteOperation;
import java.util.Date;
@@ -31,23 +31,23 @@
*/
public class DeltaValueStoreJsonImplTest extends GWTTestCase {
- private static final String SIMPLE_FOO_CLASS_NAME = "com.google.gwt.requestfactory.shared.SimpleFooRecord";
+ private static final String SIMPLE_FOO_CLASS_NAME = "com.google.gwt.requestfactory.shared.SimpleFooProxy";
/*
- * sub-classed it here so that the protected constructor of {@link RecordImpl}
+ * sub-classed it here so that the protected constructor of {@link ProxyImpl}
* can remain as such.
*/
- private class MyRecordImpl extends RecordImpl {
+ private class MyProxyImpl extends ProxyImpl {
- protected MyRecordImpl(RecordJsoImpl record) {
- super(record, false);
+ protected MyProxyImpl(ProxyJsoImpl proxy) {
+ super(proxy, false);
}
}
ValueStoreJsonImpl valueStore = null;
RequestFactoryJsonImpl requestFactory = null;
- RecordJsoImpl jso = null;
+ ProxyJsoImpl jso = null;
@Override
public String getModuleName() {
@@ -59,22 +59,22 @@
valueStore = new ValueStoreJsonImpl();
requestFactory = (RequestFactoryJsonImpl) SimpleRequestFactoryInstance.factory();
- // add a record
- jso = RecordJsoImpl.fromJson("{}");
- jso.set(SimpleFooRecord.id, 42L);
- jso.set(SimpleFooRecord.version, 1);
- jso.set(SimpleFooRecord.userName, "bovik");
- jso.set(SimpleFooRecord.password, "bovik");
- jso.set(SimpleFooRecord.intId, 4);
- jso.set(SimpleFooRecord.created, new Date());
- jso.set(SimpleFooRecord.boolField, false);
- jso.set(SimpleFooRecord.otherBoolField, true);
+ // add a proxy
+ jso = ProxyJsoImpl.fromJson("{}");
+ jso.set(SimpleFooProxy.id, 42L);
+ jso.set(SimpleFooProxy.version, 1);
+ jso.set(SimpleFooProxy.userName, "bovik");
+ jso.set(SimpleFooProxy.password, "bovik");
+ jso.set(SimpleFooProxy.intId, 4);
+ jso.set(SimpleFooProxy.created, new Date());
+ jso.set(SimpleFooProxy.boolField, false);
+ jso.set(SimpleFooProxy.otherBoolField, true);
jso.setSchema(SimpleRequestFactoryInstance.schema());
- valueStore.setRecord(jso, requestFactory);
+ valueStore.setProxy(jso, requestFactory);
}
public void testCreate() {
- Record created = requestFactory.create(SimpleFooRecord.class);
+ EntityProxy created = requestFactory.create(SimpleFooProxy.class);
assertNotNull(created.getId());
assertNotNull(created.getVersion());
@@ -86,7 +86,7 @@
}
public void testCreateWithSet() {
- Record created = requestFactory.create(SimpleFooRecord.class);
+ EntityProxy created = requestFactory.create(SimpleFooProxy.class);
assertNotNull(created.getId());
assertNotNull(created.getVersion());
@@ -94,37 +94,37 @@
valueStore, requestFactory);
// DVS does not know about the created entity.
assertFalse(deltaValueStore.isChanged());
- deltaValueStore.set(SimpleFooRecord.userName, created, "harry");
+ deltaValueStore.set(SimpleFooProxy.userName, created, "harry");
assertTrue(deltaValueStore.isChanged());
- testAndGetChangeRecord(deltaValueStore.toJson(), WriteOperation.CREATE);
+ testAndGetChangeProxy(deltaValueStore.toJson(), WriteOperation.CREATE);
}
public void testCreateUpdate() {
- Record created = requestFactory.create(SimpleFooRecord.class);
+ EntityProxy created = requestFactory.create(SimpleFooProxy.class);
DeltaValueStoreJsonImpl deltaValueStore = new DeltaValueStoreJsonImpl(
valueStore, requestFactory);
// DVS does not know about the created entity.
assertFalse(deltaValueStore.isChanged());
- deltaValueStore.set(SimpleFooRecord.userName, created, "harry");
+ deltaValueStore.set(SimpleFooProxy.userName, created, "harry");
assertTrue(deltaValueStore.isChanged());
- JSONObject changeRecord = testAndGetChangeRecord(deltaValueStore.toJson(),
+ JSONObject changeProxy = testAndGetChangeProxy(deltaValueStore.toJson(),
WriteOperation.CREATE);
assertEquals(
"harry",
- changeRecord.get(SimpleFooRecord.userName.getName()).isString().stringValue());
+ changeProxy.get(SimpleFooProxy.userName.getName()).isString().stringValue());
}
public void testOperationAfterJson() {
DeltaValueStoreJsonImpl deltaValueStore = new DeltaValueStoreJsonImpl(
valueStore, requestFactory);
- deltaValueStore.set(SimpleFooRecord.userName, new MyRecordImpl(jso),
+ deltaValueStore.set(SimpleFooProxy.userName, new MyProxyImpl(jso),
"newHarry");
assertTrue(deltaValueStore.isChanged());
deltaValueStore.toJson();
try {
- deltaValueStore.set(SimpleFooRecord.userName, new MyRecordImpl(jso),
+ deltaValueStore.set(SimpleFooProxy.userName, new MyProxyImpl(jso),
"harry");
fail("Modifying DeltaValueStore after calling toJson should throw a RuntimeException");
} catch (RuntimeException ex) {
@@ -132,23 +132,23 @@
}
deltaValueStore.clearUsed();
- deltaValueStore.set(SimpleFooRecord.userName, new MyRecordImpl(jso),
+ deltaValueStore.set(SimpleFooProxy.userName, new MyProxyImpl(jso),
"harry");
}
public void testSeparateIds() {
- RecordImpl createRecord = (RecordImpl) requestFactory.create(SimpleFooRecord.class);
- assertTrue(createRecord.isFuture());
- Long futureId = createRecord.getId();
+ ProxyImpl createProxy = (ProxyImpl) requestFactory.create(SimpleFooProxy.class);
+ assertTrue(createProxy.isFuture());
+ Long futureId = createProxy.getId();
- RecordImpl mockRecord = new RecordImpl(RecordJsoImpl.create(futureId, 1,
+ ProxyImpl mockProxy = new ProxyImpl(ProxyJsoImpl.create(futureId, 1,
SimpleRequestFactoryInstance.schema()), RequestFactoryJsonImpl.NOT_FUTURE);
- valueStore.setRecord(mockRecord.asJso(), requestFactory); // marked as non-future..
+ valueStore.setProxy(mockProxy.asJso(), requestFactory); // marked as non-future..
DeltaValueStoreJsonImpl deltaValueStore = new DeltaValueStoreJsonImpl(
valueStore, requestFactory);
- deltaValueStore.set(SimpleFooRecord.userName, createRecord, "harry");
- deltaValueStore.set(SimpleFooRecord.userName, mockRecord, "bovik");
+ deltaValueStore.set(SimpleFooProxy.userName, createProxy, "harry");
+ deltaValueStore.set(SimpleFooProxy.userName, mockProxy, "bovik");
assertTrue(deltaValueStore.isChanged());
String jsonString = deltaValueStore.toJson();
JSONObject jsonObject = (JSONObject) JSONParser.parseLenient(jsonString);
@@ -161,30 +161,30 @@
assertEquals(1, createOperationArray.size());
assertEquals("harry", createOperationArray.get(0).isObject().get(
SIMPLE_FOO_CLASS_NAME).isObject().get(
- SimpleFooRecord.userName.getName()).isString().stringValue());
+ SimpleFooProxy.userName.getName()).isString().stringValue());
JSONArray updateOperationArray = jsonObject.get(
WriteOperation.UPDATE.name()).isArray();
assertEquals(1, updateOperationArray.size());
assertEquals("bovik", updateOperationArray.get(0).isObject().get(
SIMPLE_FOO_CLASS_NAME).isObject().get(
- SimpleFooRecord.userName.getName()).isString().stringValue());
+ SimpleFooProxy.userName.getName()).isString().stringValue());
}
public void testUpdate() {
DeltaValueStoreJsonImpl deltaValueStore = new DeltaValueStoreJsonImpl(
valueStore, requestFactory);
- deltaValueStore.set(SimpleFooRecord.userName, new MyRecordImpl(jso),
+ deltaValueStore.set(SimpleFooProxy.userName, new MyProxyImpl(jso),
"harry");
assertTrue(deltaValueStore.isChanged());
- JSONObject changeRecord = testAndGetChangeRecord(deltaValueStore.toJson(),
+ JSONObject changeProxy = testAndGetChangeProxy(deltaValueStore.toJson(),
WriteOperation.UPDATE);
assertEquals(
"harry",
- changeRecord.get(SimpleFooRecord.userName.getName()).isString().stringValue());
+ changeProxy.get(SimpleFooProxy.userName.getName()).isString().stringValue());
}
- private JSONObject testAndGetChangeRecord(String jsonString,
+ private JSONObject testAndGetChangeProxy(String jsonString,
WriteOperation currentWriteOperation) {
JSONObject jsonObject = (JSONObject) JSONParser.parseLenient(jsonString);
for (WriteOperation writeOperation : WriteOperation.values()) {
@@ -198,14 +198,14 @@
JSONArray writeOperationArray = jsonObject.get(currentWriteOperation.name()).isArray();
assertEquals(1, writeOperationArray.size());
- JSONObject recordWithName = writeOperationArray.get(0).isObject();
- assertEquals(1, recordWithName.size());
- assertTrue(recordWithName.containsKey(SIMPLE_FOO_CLASS_NAME));
+ JSONObject proxyWithName = writeOperationArray.get(0).isObject();
+ assertEquals(1, proxyWithName.size());
+ assertTrue(proxyWithName.containsKey(SIMPLE_FOO_CLASS_NAME));
- JSONObject record = recordWithName.get(SIMPLE_FOO_CLASS_NAME).isObject();
- assertTrue(record.containsKey("id"));
- assertTrue(record.containsKey("version"));
+ JSONObject proxy = proxyWithName.get(SIMPLE_FOO_CLASS_NAME).isObject();
+ assertTrue(proxy.containsKey("id"));
+ assertTrue(proxy.containsKey("version"));
- return record;
+ return proxy;
}
}
diff --git a/user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java b/user/test/com/google/gwt/requestfactory/client/impl/EntityProxyIdTest.java
similarity index 69%
rename from user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
rename to user/test/com/google/gwt/requestfactory/client/impl/EntityProxyIdTest.java
index 8f56f4c..96046a9 100644
--- a/user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
+++ b/user/test/com/google/gwt/requestfactory/client/impl/EntityProxyIdTest.java
@@ -15,8 +15,8 @@
*/
package com.google.gwt.requestfactory.client.impl;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
import junit.framework.TestCase;
@@ -24,26 +24,26 @@
/**
* Eponymous unit test.
*/
-public class RecordKeyTest extends TestCase {
+public class EntityProxyIdTest extends TestCase {
- static class Schema1 extends RecordSchema<Record> {
+ static class Schema1 extends ProxySchema<EntityProxy> {
public Schema1() {
super("schemey");
}
@Override
- public Record create(RecordJsoImpl jso, boolean isFuture) {
+ public EntityProxy create(ProxyJsoImpl jso, boolean isFuture) {
throw new UnsupportedOperationException("Auto-generated method stub");
}
@Override
- public RecordChangedEvent<?, ?> createChangeEvent(Record record,
+ public EntityProxyChangedEvent<?, ?> createChangeEvent(EntityProxy proxy,
WriteOperation writeOperation) {
throw new UnsupportedOperationException("Auto-generated method stub");
}
@Override
- public Class<? extends Record> getProxyClass() {
+ public Class<? extends EntityProxy> getProxyClass() {
throw new UnsupportedOperationException("Auto-generated method stub");
}
}
@@ -52,25 +52,25 @@
}
public void testEquals() {
- RecordKey newKey1 = new RecordKey(1L, new Schema1(),
+ EntityProxyId newKey1 = new EntityProxyId(1L, new Schema1(),
RequestFactoryJsonImpl.IS_FUTURE);
- RecordKey anotherNewKey1 = new RecordKey(newKey1.id, newKey1.schema,
+ EntityProxyId anotherNewKey1 = new EntityProxyId(newKey1.id, newKey1.schema,
newKey1.isFuture);
assertTrue(newKey1.equals(anotherNewKey1));
assertTrue(newKey1.hashCode() == anotherNewKey1.hashCode());
- RecordKey newKey2 = new RecordKey(newKey1.id + 1, newKey1.schema,
+ EntityProxyId newKey2 = new EntityProxyId(newKey1.id + 1, newKey1.schema,
newKey1.isFuture);
assertFalse(newKey1.equals(newKey2));
assertFalse(newKey1.hashCode() == newKey2.hashCode());
- RecordKey newKey1NoSchema = new RecordKey(newKey1.id,
+ EntityProxyId newKey1NoSchema = new EntityProxyId(newKey1.id,
new Schema2(), newKey1.isFuture);
assertFalse(newKey1.equals(newKey1NoSchema));
assertFalse(newKey1.hashCode() == newKey1NoSchema.hashCode());
- RecordKey oldKey1 = new RecordKey(newKey1.id, newKey1.schema,
+ EntityProxyId oldKey1 = new EntityProxyId(newKey1.id, newKey1.schema,
!newKey1.isFuture);
assertFalse(newKey1.equals(oldKey1));
assertFalse(newKey1.hashCode() == oldKey1.hashCode());
diff --git a/user/test/com/google/gwt/requestfactory/client/impl/RecordJsoImplTest.java b/user/test/com/google/gwt/requestfactory/client/impl/ProxyJsoImplTest.java
similarity index 61%
rename from user/test/com/google/gwt/requestfactory/client/impl/RecordJsoImplTest.java
rename to user/test/com/google/gwt/requestfactory/client/impl/ProxyJsoImplTest.java
index 06df0de..0f52745 100644
--- a/user/test/com/google/gwt/requestfactory/client/impl/RecordJsoImplTest.java
+++ b/user/test/com/google/gwt/requestfactory/client/impl/ProxyJsoImplTest.java
@@ -18,16 +18,16 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.requestfactory.client.SimpleRequestFactoryInstance;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
/**
- * Tests for {@link RecordJsoImpl}.
+ * Tests for {@link ProxyJsoImpl}.
*/
-public class RecordJsoImplTest extends GWTTestCase {
+public class ProxyJsoImplTest extends GWTTestCase {
private static final String ALL_PROPERTIES_JSON;
static {
@@ -90,19 +90,19 @@
}
public void testEmptyCopy() {
- RecordJsoImpl emptyCopy = RecordJsoImpl.emptyCopy(getPopulatedJso());
+ ProxyJsoImpl emptyCopy = ProxyJsoImpl.emptyCopy(getPopulatedJso());
testMinimalJso(emptyCopy, SCHEMA_PRESENT);
}
public void testFromJson() {
- testEmptyJso(RecordJsoImpl.fromJson(EMPTY_JSON), SCHEMA_ABSENT);
- testMinimalJso(RecordJsoImpl.fromJson(ID_VERSION_JSON), SCHEMA_ABSENT);
- testPopulatedJso(RecordJsoImpl.fromJson(ALL_PROPERTIES_JSON), SCHEMA_ABSENT);
+ testEmptyJso(ProxyJsoImpl.fromJson(EMPTY_JSON), SCHEMA_ABSENT);
+ testMinimalJso(ProxyJsoImpl.fromJson(ID_VERSION_JSON), SCHEMA_ABSENT);
+ testPopulatedJso(ProxyJsoImpl.fromJson(ALL_PROPERTIES_JSON), SCHEMA_ABSENT);
}
public void testFromJsonArray() {
String jsonString = "[" + ID_VERSION_JSON + "," + ID_VERSION_JSON2 + "]";
- JsArray<RecordJsoImpl> jsArray = RecordJsoImpl.arrayFromJson(jsonString);
+ JsArray<ProxyJsoImpl> jsArray = ProxyJsoImpl.arrayFromJson(jsonString);
assertEquals(2, jsArray.length());
}
@@ -119,30 +119,30 @@
}
public void testSet() {
- RecordJsoImpl jso = getMinimalJso();
+ ProxyJsoImpl jso = getMinimalJso();
- jso.set(SimpleFooRecord.userName, "bovik");
- jso.set(SimpleFooRecord.password, "bovik");
+ jso.set(SimpleFooProxy.userName, "bovik");
+ jso.set(SimpleFooProxy.password, "bovik");
- jso.set(SimpleFooRecord.charField, 'c');
+ jso.set(SimpleFooProxy.charField, 'c');
- jso.set(SimpleFooRecord.longField, 1234567890L);
- jso.set(SimpleFooRecord.bigDecimalField, new BigDecimal(
+ jso.set(SimpleFooProxy.longField, 1234567890L);
+ jso.set(SimpleFooProxy.bigDecimalField, new BigDecimal(
"12345678901234.5678901234567890"));
- jso.set(SimpleFooRecord.bigIntField, new BigInteger(
+ jso.set(SimpleFooProxy.bigIntField, new BigInteger(
"123456789012345678901234567890"));
- jso.set(SimpleFooRecord.intId, 4);
- jso.set(SimpleFooRecord.shortField, (short) 5);
- jso.set(SimpleFooRecord.byteField, (byte) 6);
+ jso.set(SimpleFooProxy.intId, 4);
+ jso.set(SimpleFooProxy.shortField, (short) 5);
+ jso.set(SimpleFooProxy.byteField, (byte) 6);
- jso.set(SimpleFooRecord.created, new Date(400));
+ jso.set(SimpleFooProxy.created, new Date(400));
- jso.set(SimpleFooRecord.doubleField, 12345.6789);
- jso.set(SimpleFooRecord.floatField, 12.3456789f);
+ jso.set(SimpleFooProxy.doubleField, 12345.6789);
+ jso.set(SimpleFooProxy.floatField, 12.3456789f);
- jso.set(SimpleFooRecord.boolField, false);
- jso.set(SimpleFooRecord.otherBoolField, true);
+ jso.set(SimpleFooProxy.boolField, false);
+ jso.set(SimpleFooProxy.otherBoolField, true);
testPopulatedJso(jso, SCHEMA_PRESENT);
}
@@ -151,31 +151,31 @@
assertEquals(ID_VERSION_JSON, getMinimalJso().toJson());
}
- private RecordJsoImpl getEmptyJso() {
- return RecordJsoImpl.create();
+ private ProxyJsoImpl getEmptyJso() {
+ return ProxyJsoImpl.create();
}
- private RecordJsoImpl getMinimalJso() {
- return RecordJsoImpl.create(42L, 1, SimpleRequestFactoryInstance.schema());
+ private ProxyJsoImpl getMinimalJso() {
+ return ProxyJsoImpl.create(42L, 1, SimpleRequestFactoryInstance.schema());
}
- private RecordJsoImpl getPopulatedJso() {
- RecordJsoImpl jso = getMinimalJso();
- jso.set(SimpleFooRecord.userName, "bovik");
- jso.set(SimpleFooRecord.password, "bovik");
- jso.set(SimpleFooRecord.intId, 4);
- jso.set(SimpleFooRecord.created, new Date(400));
+ private ProxyJsoImpl getPopulatedJso() {
+ ProxyJsoImpl jso = getMinimalJso();
+ jso.set(SimpleFooProxy.userName, "bovik");
+ jso.set(SimpleFooProxy.password, "bovik");
+ jso.set(SimpleFooProxy.intId, 4);
+ jso.set(SimpleFooProxy.created, new Date(400));
return jso;
}
- private void testEmptyJso(RecordJsoImpl jso, boolean schemaPresent) {
- assertFalse(jso.isDefined(SimpleFooRecord.id.getName()));
- assertFalse(jso.isDefined(SimpleFooRecord.version.getName()));
+ private void testEmptyJso(ProxyJsoImpl jso, boolean schemaPresent) {
+ assertFalse(jso.isDefined(SimpleFooProxy.id.getName()));
+ assertFalse(jso.isDefined(SimpleFooProxy.version.getName()));
assertEquals("{}", jso.toJson());
testSchema(jso, schemaPresent);
}
- private void testMinimalJso(RecordJsoImpl jso, boolean schemaPresent) {
+ private void testMinimalJso(ProxyJsoImpl jso, boolean schemaPresent) {
for (String property : new String[] {"id", "version"}) {
assertTrue(jso.isDefined(property));
}
@@ -186,12 +186,12 @@
}
assertEquals((Long) 42L, jso.getId());
assertEquals(new Integer(1), jso.getVersion());
- assertEquals(null, jso.get(SimpleFooRecord.longField));
- assertEquals(null, jso.get(SimpleFooRecord.enumField));
+ assertEquals(null, jso.get(SimpleFooProxy.longField));
+ assertEquals(null, jso.get(SimpleFooProxy.enumField));
testSchema(jso, schemaPresent);
}
- private void testPopulatedJso(RecordJsoImpl jso, boolean schemaPresent) {
+ private void testPopulatedJso(ProxyJsoImpl jso, boolean schemaPresent) {
for (String property : new String[] {
"userName", "password", "charField", "longField", "bigDecimalField",
"bigIntField", "intId", "shortField", "byteField", "created",
@@ -200,30 +200,30 @@
assertTrue("Expect " + property + " to be defined",
jso.isDefined(property));
}
- assertEquals("bovik", jso.get(SimpleFooRecord.userName));
- assertEquals("bovik", jso.get(SimpleFooRecord.password));
+ assertEquals("bovik", jso.get(SimpleFooProxy.userName));
+ assertEquals("bovik", jso.get(SimpleFooProxy.password));
- assertEquals(new Character('c'), jso.get(SimpleFooRecord.charField));
+ assertEquals(new Character('c'), jso.get(SimpleFooProxy.charField));
- assertEquals(new Long(1234567890L), jso.get(SimpleFooRecord.longField));
+ assertEquals(new Long(1234567890L), jso.get(SimpleFooProxy.longField));
assertEquals(new BigDecimal("12345678901234.5678901234567890"),
- jso.get(SimpleFooRecord.bigDecimalField));
+ jso.get(SimpleFooProxy.bigDecimalField));
assertEquals(new BigInteger("123456789012345678901234567890"),
- jso.get(SimpleFooRecord.bigIntField));
+ jso.get(SimpleFooProxy.bigIntField));
- assertEquals(Integer.valueOf(4), jso.get(SimpleFooRecord.intId));
- assertEquals(Short.valueOf((short) 5), jso.get(SimpleFooRecord.shortField));
- assertEquals(Byte.valueOf((byte) 6), jso.get(SimpleFooRecord.byteField));
+ assertEquals(Integer.valueOf(4), jso.get(SimpleFooProxy.intId));
+ assertEquals(Short.valueOf((short) 5), jso.get(SimpleFooProxy.shortField));
+ assertEquals(Byte.valueOf((byte) 6), jso.get(SimpleFooProxy.byteField));
- assertEquals(new Date(400), jso.get(SimpleFooRecord.created));
- assertEquals(Double.valueOf(12345.6789), jso.get(SimpleFooRecord.doubleField));
+ assertEquals(new Date(400), jso.get(SimpleFooProxy.created));
+ assertEquals(Double.valueOf(12345.6789), jso.get(SimpleFooProxy.doubleField));
int expected = (int) (Float.valueOf(12.3456789f) * 1000);
- int actual = (int) (jso.get(SimpleFooRecord.floatField) * 1000);
+ int actual = (int) (jso.get(SimpleFooProxy.floatField) * 1000);
assertEquals(expected, actual);
- assertFalse(jso.get(SimpleFooRecord.boolField));
- assertTrue(jso.get(SimpleFooRecord.otherBoolField));
+ assertFalse(jso.get(SimpleFooProxy.boolField));
+ assertTrue(jso.get(SimpleFooProxy.otherBoolField));
assertEquals((Long) 42L, jso.getId());
assertEquals(new Integer(1), jso.getVersion());
@@ -231,7 +231,7 @@
testSchema(jso, schemaPresent);
}
- private void testSchema(RecordJsoImpl jso, boolean schemaPresent) {
+ private void testSchema(ProxyJsoImpl jso, boolean schemaPresent) {
if (schemaPresent) {
assertEquals(SimpleRequestFactoryInstance.schema(), jso.getSchema());
} else {
diff --git a/user/test/com/google/gwt/requestfactory/client/impl/SimpleBazRecordImpl.java b/user/test/com/google/gwt/requestfactory/client/impl/SimpleBazProxyImpl.java
similarity index 67%
rename from user/test/com/google/gwt/requestfactory/client/impl/SimpleBazRecordImpl.java
rename to user/test/com/google/gwt/requestfactory/client/impl/SimpleBazProxyImpl.java
index a2bec3e..36c1712 100644
--- a/user/test/com/google/gwt/requestfactory/client/impl/SimpleBazRecordImpl.java
+++ b/user/test/com/google/gwt/requestfactory/client/impl/SimpleBazProxyImpl.java
@@ -16,8 +16,8 @@
package com.google.gwt.requestfactory.client.impl;
import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.EntityProxy;
+import com.google.gwt.requestfactory.shared.EntityProxyChangedEvent;
import com.google.gwt.requestfactory.shared.WriteOperation;
import java.util.Collections;
@@ -27,12 +27,12 @@
/**
* Just a dummy class for testing purposes.
*/
-public class SimpleBazRecordImpl extends RecordImpl {
+public class SimpleBazProxyImpl extends ProxyImpl {
/**
* The Schema class.
*/
- public static class MySchema extends RecordSchema<SimpleBazRecordImpl> {
+ public static class MySchema extends ProxySchema<SimpleBazProxyImpl> {
private final Set<Property<?>> allProperties;
{
@@ -42,7 +42,7 @@
}
public MySchema() {
- super(SimpleBazRecordImpl.class.getName());
+ super(SimpleBazProxyImpl.class.getName());
}
@Override
@@ -51,27 +51,27 @@
}
@Override
- public SimpleBazRecordImpl create(RecordJsoImpl jso, boolean isFuture) {
- return new SimpleBazRecordImpl(jso, isFuture);
+ public SimpleBazProxyImpl create(ProxyJsoImpl jso, boolean isFuture) {
+ return new SimpleBazProxyImpl(jso, isFuture);
}
@Override
- public RecordChangedEvent<?, ?> createChangeEvent(Record record,
+ public EntityProxyChangedEvent<?, ?> createChangeEvent(EntityProxy proxy,
WriteOperation writeOperation) {
// ignore
return null;
}
@Override
- public Class<? extends Record> getProxyClass() {
+ public Class<? extends EntityProxy> getProxyClass() {
// ignore
return null;
}
}
- public static final RecordSchema<SimpleBazRecordImpl> SCHEMA = new MySchema();
+ public static final ProxySchema<SimpleBazProxyImpl> SCHEMA = new MySchema();
- private SimpleBazRecordImpl(RecordJsoImpl jso, boolean isFuture) {
+ private SimpleBazProxyImpl(ProxyJsoImpl jso, boolean isFuture) {
super(jso, isFuture);
}
}
diff --git a/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java b/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
index 7588e48..b3b14f7 100644
--- a/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
+++ b/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
@@ -17,7 +17,7 @@
import com.google.gwt.requestfactory.shared.RequestData;
import com.google.gwt.requestfactory.shared.SimpleEnum;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import com.google.gwt.requestfactory.shared.WriteOperation;
import junit.framework.TestCase;
@@ -225,10 +225,10 @@
private JSONObject getResultFromServer(JSONObject foo) throws JSONException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException,
ClassNotFoundException {
- JSONObject recordWithSchema = new JSONObject();
- recordWithSchema.put(SimpleFooRecord.class.getName(), foo);
+ JSONObject proxyWithSchema = new JSONObject();
+ proxyWithSchema.put(SimpleFooProxy.class.getName(), foo);
JSONArray arr = new JSONArray();
- arr.put(recordWithSchema);
+ arr.put(proxyWithSchema);
JSONObject operation = new JSONObject();
operation.put(WriteOperation.UPDATE.toString(), arr);
JSONObject sync = new JSONObject();
@@ -236,7 +236,7 @@
"com.google.gwt.requestfactory.shared.SimpleFooRequest::persist");
sync.put(RequestData.CONTENT_TOKEN, operation.toString());
sync.put(RequestData.PARAM_TOKEN + "0", foo.getInt("id") + "-NO" + "-"
- + SimpleFooRecord.class.getName());
+ + SimpleFooProxy.class.getName());
return (JSONObject) requestProcessor.processJsonRequest(sync.toString());
}
}
diff --git a/user/test/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistryTest.java b/user/test/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistryTest.java
index d69cc4f..e3b62be 100644
--- a/user/test/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistryTest.java
+++ b/user/test/com/google/gwt/requestfactory/server/ReflectionBasedOperationRegistryTest.java
@@ -15,7 +15,7 @@
*/
package com.google.gwt.requestfactory.server;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.SimpleFooProxy;
import junit.framework.TestCase;
@@ -40,7 +40,7 @@
assertEquals("com.google.gwt.requestfactory.server.SimpleFoo",
request.getDomainClassName());
assertEquals("findAll", request.getDomainMethodName());
- assertEquals(SimpleFooRecord.class, request.getReturnType());
+ assertEquals(SimpleFooProxy.class, request.getReturnType());
assertEquals(0, request.getParameterTypes().length);
assertEquals(true, request.isReturnTypeList());
}
@@ -62,7 +62,7 @@
assertEquals("com.google.gwt.requestfactory.server.SimpleFoo",
request.getDomainClassName());
assertEquals("findSimpleFooById", request.getDomainMethodName());
- assertEquals(SimpleFooRecord.class, request.getReturnType());
+ assertEquals(SimpleFooProxy.class, request.getReturnType());
assert request.getParameterTypes().length == 1
&& request.getParameterTypes()[0] == Long.class;
assertEquals(false, request.isReturnTypeList());
diff --git a/user/test/com/google/gwt/requestfactory/shared/SimpleBarRecord.java b/user/test/com/google/gwt/requestfactory/shared/SimpleBarProxy.java
similarity index 91%
rename from user/test/com/google/gwt/requestfactory/shared/SimpleBarRecord.java
rename to user/test/com/google/gwt/requestfactory/shared/SimpleBarProxy.java
index c3aef9f..23c7f12 100644
--- a/user/test/com/google/gwt/requestfactory/shared/SimpleBarRecord.java
+++ b/user/test/com/google/gwt/requestfactory/shared/SimpleBarProxy.java
@@ -21,8 +21,8 @@
* A simple entity used for testing. Has an int field and date field. Add other data types as their
* support gets built in.
*/
-@DataTransferObject(SimpleBar.class)
-public interface SimpleBarRecord extends Record {
+@ProxyFor(SimpleBar.class)
+public interface SimpleBarProxy extends EntityProxy {
Property<String> userName = new Property<String>("userName", "User Name",
String.class);
diff --git a/user/test/com/google/gwt/requestfactory/shared/SimpleBarRecordChanged.java b/user/test/com/google/gwt/requestfactory/shared/SimpleBarProxyChanged.java
similarity index 73%
rename from user/test/com/google/gwt/requestfactory/shared/SimpleBarRecordChanged.java
rename to user/test/com/google/gwt/requestfactory/shared/SimpleBarProxyChanged.java
index 0a1dcf2..62fe93e 100644
--- a/user/test/com/google/gwt/requestfactory/shared/SimpleBarRecordChanged.java
+++ b/user/test/com/google/gwt/requestfactory/shared/SimpleBarProxyChanged.java
@@ -18,24 +18,24 @@
import com.google.gwt.event.shared.EventHandler;
/**
- * Test implementation of {@link com.google.gwt.requestfactory.shared.RecordChangedEvent} for
- * {@link com.google.gwt.requestfactory.shared.SimpleFooRecord}.
+ * Test implementation of {@link com.google.gwt.requestfactory.shared.EntityProxyChangedEvent} for
+ * {@link com.google.gwt.requestfactory.shared.SimpleFooProxy}.
*/
-public class SimpleBarRecordChanged extends
- RecordChangedEvent<SimpleBarRecord, SimpleBarRecordChanged.Handler> {
+public class SimpleBarProxyChanged extends
+ EntityProxyChangedEvent<SimpleBarProxy, SimpleBarProxyChanged.Handler> {
/**
* Test Handler for SimpleFooChanged event.
*/
public interface Handler extends EventHandler {
- void onSimpleBarRecordChanged(SimpleBarRecordChanged record);
+ void onSimpleBarProxyChanged(SimpleBarProxyChanged proxy);
}
public static final Type<Handler> TYPE = new Type<Handler>();
- public SimpleBarRecordChanged(SimpleBarRecord record,
+ public SimpleBarProxyChanged(SimpleBarProxy proxy,
WriteOperation writeOperation) {
- super(record, writeOperation);
+ super(proxy, writeOperation);
}
@Override
@@ -45,6 +45,6 @@
@Override
protected void dispatch(Handler handler) {
- handler.onSimpleBarRecordChanged(this);
+ handler.onSimpleBarProxyChanged(this);
}
}
diff --git a/user/test/com/google/gwt/requestfactory/shared/SimpleBarRequest.java b/user/test/com/google/gwt/requestfactory/shared/SimpleBarRequest.java
index 6136b11..553808a 100644
--- a/user/test/com/google/gwt/requestfactory/shared/SimpleBarRequest.java
+++ b/user/test/com/google/gwt/requestfactory/shared/SimpleBarRequest.java
@@ -23,15 +23,15 @@
RequestObject<Long> countSimpleBar();
- RecordListRequest<SimpleBarRecord> findAll();
+ ProxyListRequest<SimpleBarProxy> findAll();
- RecordRequest<SimpleBarRecord> findSimpleBarById(Long id);
+ ProxyRequest<SimpleBarProxy> findSimpleBarById(Long id);
@Instance
- RequestObject<Void> persist(SimpleBarRecord record);
+ RequestObject<Void> persist(SimpleBarProxy proxy);
@Instance
- RecordRequest<SimpleBarRecord> persistAndReturnSelf(SimpleBarRecord record);
+ ProxyRequest<SimpleBarProxy> persistAndReturnSelf(SimpleBarProxy proxy);
RequestObject<Void> reset();
}
diff --git a/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecord.java b/user/test/com/google/gwt/requestfactory/shared/SimpleFooProxy.java
similarity index 87%
rename from user/test/com/google/gwt/requestfactory/shared/SimpleFooRecord.java
rename to user/test/com/google/gwt/requestfactory/shared/SimpleFooProxy.java
index cd7a476..03af72d 100644
--- a/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecord.java
+++ b/user/test/com/google/gwt/requestfactory/shared/SimpleFooProxy.java
@@ -25,8 +25,8 @@
* A simple entity used for testing. Has an int field and date field. Add other
* data types as their support gets built in.
*/
-@DataTransferObject(SimpleFoo.class)
-public interface SimpleFooRecord extends Record {
+@ProxyFor(SimpleFoo.class)
+public interface SimpleFooProxy extends EntityProxy {
Property<String> userName = new Property<String>("userName", "User Name",
String.class);
@@ -55,13 +55,13 @@
Property<Boolean> boolField = new Property<Boolean>("boolField", Boolean.class);
Property<Boolean> otherBoolField = new Property<Boolean>("otherBoolField", Boolean.class);
- Property<SimpleBarRecord> barField = new Property<SimpleBarRecord>("barField",
- SimpleBarRecord.class);
+ Property<SimpleBarProxy> barField = new Property<SimpleBarProxy>("barField",
+ SimpleBarProxy.class);
- Property<SimpleFooRecord> fooField = new Property<SimpleFooRecord>("fooField",
- SimpleFooRecord.class);
+ Property<SimpleFooProxy> fooField = new Property<SimpleFooProxy>("fooField",
+ SimpleFooProxy.class);
- SimpleBarRecord getBarField();
+ SimpleBarProxy getBarField();
BigDecimal getBigDecimalField();
@@ -81,7 +81,7 @@
Float getFloatField();
- SimpleFooRecord getFooField();
+ SimpleFooProxy getFooField();
Integer getIntId();
@@ -95,7 +95,7 @@
String getUserName();
- void setBarField(SimpleBarRecord barField);
+ void setBarField(SimpleBarProxy barField);
void setBigDecimalField(BigDecimal d);
@@ -113,7 +113,7 @@
void setFloatField(Float f);
- void setFooField(SimpleFooRecord fooField);
+ void setFooField(SimpleFooProxy fooField);
void setIntId(Integer intId);
diff --git a/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecordChanged.java b/user/test/com/google/gwt/requestfactory/shared/SimpleFooProxyChanged.java
similarity index 72%
rename from user/test/com/google/gwt/requestfactory/shared/SimpleFooRecordChanged.java
rename to user/test/com/google/gwt/requestfactory/shared/SimpleFooProxyChanged.java
index 07c431f..4ab65ff 100644
--- a/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecordChanged.java
+++ b/user/test/com/google/gwt/requestfactory/shared/SimpleFooProxyChanged.java
@@ -18,24 +18,24 @@
import com.google.gwt.event.shared.EventHandler;
/**
- * Test implementation of {@link RecordChangedEvent} for
- * {@link SimpleFooRecord}.
+ * Test implementation of {@link EntityProxyChangedEvent} for
+ * {@link SimpleFooProxy}.
*/
-public class SimpleFooRecordChanged extends
- RecordChangedEvent<SimpleFooRecord, SimpleFooRecordChanged.Handler> {
+public class SimpleFooProxyChanged extends
+ EntityProxyChangedEvent<SimpleFooProxy, SimpleFooProxyChanged.Handler> {
/**
* Test Handler for SimpleFooChanged event.
*/
public interface Handler extends EventHandler {
- void onSimpleFooRecordChanged(SimpleFooRecordChanged record);
+ void onSimpleFooProxyChanged(SimpleFooProxyChanged proxy);
}
public static final Type<Handler> TYPE = new Type<Handler>();
- public SimpleFooRecordChanged(SimpleFooRecord record,
+ public SimpleFooProxyChanged(SimpleFooProxy proxy,
WriteOperation writeOperation) {
- super(record, writeOperation);
+ super(proxy, writeOperation);
}
@Override
@@ -45,6 +45,6 @@
@Override
protected void dispatch(Handler handler) {
- handler.onSimpleFooRecordChanged(this);
+ handler.onSimpleFooProxyChanged(this);
}
}
diff --git a/user/test/com/google/gwt/requestfactory/shared/SimpleFooRequest.java b/user/test/com/google/gwt/requestfactory/shared/SimpleFooRequest.java
index 546c7cf..accc1f9 100644
--- a/user/test/com/google/gwt/requestfactory/shared/SimpleFooRequest.java
+++ b/user/test/com/google/gwt/requestfactory/shared/SimpleFooRequest.java
@@ -23,22 +23,22 @@
RequestObject<Long> countSimpleFoo();
@Instance
- RequestObject<Long> countSimpleFooWithUserNameSideEffect(SimpleFooRecord record);
+ RequestObject<Long> countSimpleFooWithUserNameSideEffect(SimpleFooProxy proxy);
- RecordListRequest<SimpleFooRecord> findAll();
+ ProxyListRequest<SimpleFooProxy> findAll();
- RecordRequest<SimpleFooRecord> findSimpleFooById(Long id);
+ ProxyRequest<SimpleFooProxy> findSimpleFooById(Long id);
RequestObject<Integer> privateMethod();
@Instance
- RequestObject<Void> persist(SimpleFooRecord record);
+ RequestObject<Void> persist(SimpleFooProxy proxy);
@Instance
- RecordRequest<SimpleFooRecord> persistAndReturnSelf(SimpleFooRecord record);
+ ProxyRequest<SimpleFooProxy> persistAndReturnSelf(SimpleFooProxy proxy);
RequestObject<Void> reset();
@Instance
- RequestObject<String> hello(SimpleFooRecord instance, SimpleBarRecord record);
+ RequestObject<String> hello(SimpleFooProxy instance, SimpleBarProxy proxy);
}