Переделана публикация текущего проекта как теста, из за автоинкремента делается после создания объекта бд.
This commit is contained in:
@@ -22,4 +22,8 @@ public class EditServerObject<S extends RepositoryServer, D extends riDBObject>
|
||||
protected void ServerAction() throws Exception {
|
||||
EditObject(target);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
getDb().tables.get(d).ui_.Show(target.getPK());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Common.Current;
|
||||
import Common.Database.riDBObject;
|
||||
import Repository.RepositoryServer;
|
||||
public class PublishServerObject<S extends RepositoryServer, D extends riDBObject> extends ServerObjectPass<S, D> {
|
||||
protected Object pk = null;
|
||||
public PublishServerObject(S server_in, Class<D> d_in) {
|
||||
super(server_in, d_in);
|
||||
}
|
||||
@@ -13,6 +14,7 @@ public class PublishServerObject<S extends RepositoryServer, D extends riDBObjec
|
||||
//--
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
pk = null;
|
||||
if (Current.getAccount().CheckRegistered(Log)) {
|
||||
target = d.newInstance();
|
||||
target.sender_name = Current.getAccount().name;
|
||||
@@ -25,5 +27,11 @@ public class PublishServerObject<S extends RepositoryServer, D extends riDBObjec
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
PublishObject(target);
|
||||
pk = response.object;
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
getDb().tables.get(d).ui_.Show(pk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,6 @@ public abstract class ServerObjectPass <S extends RepositoryServer, D extends DB
|
||||
super.performFinish();
|
||||
passes.get(getDb().getSynchronizePassCode()).Do();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
getDb().tables.get(d).ui_.Show(target.getPK());
|
||||
}
|
||||
//-
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
return getDb().tables.get(d).ShowAddObjectDialog(target);
|
||||
|
||||
Reference in New Issue
Block a user