|
Re: Trouble after updating to nightly Luna build [message #1268262 is a reply to message #1268249] |
Mon, 10 March 2014 09:14 |
Jeremie Bresson Messages: 1252 Registered: October 2011 |
Senior Member |
|
|
Nice to start a such thread. I had the same idea in mind.
Quote:in two places I've been creating instances of SwtScoutAction() which seems to have disappeared. How do I replace these?
With bug 424525, I have done some refactorings and bug fixes. I double checked: SwtScoutAction now extends AbstractSwtScoutAction, but the API (constructors, ...) should be the same.
Can you post a code snippet?
Quote: It seems that the package name for the Derby support has been renamed, maybe it would be worthwhile mentioning this in the 4.0 Milestone page linked above.
Feel free to write something in the wiki.
Quote:in my SWT client the DesktopMenuBar class has used the following call:
SwtMenuUtility.getMenuContribution(menus, env);
it seems that this method is no longer part of the MenuUtility. How do I replace it?
SwtMenuUtility.getMenuContribution(menus, env) with menus as Array do not exist anymore.
You can fix it with the List method:
SwtMenuUtility.getMenuContribution(List, ISwtEnvironment)
I had this in DesktopMenuBar.
The fix (switch from array to list) is also OK because
env.getClientSession().getDesktop().getMenus() also return a list instead of an array.
This is not a long term solution, because SwtMenuUtility.getMenuContribution(List, ISwtEnvironment) is deprecated.
[Updated on: Mon, 10 March 2014 09:28] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Trouble after updating to nightly Luna build [message #1273119 is a reply to message #1270857] |
Wed, 19 March 2014 14:46 |
Urs Beeli Messages: 573 Registered: October 2012 Location: Bern, Switzerland |
Senior Member |
|
|
Thanks for all the help, I now have my sandbox project compiling again. However, there are still some errors when running it. My sandbox project is based on the minicrm tutorial. One part that is not working is the "Person to Role" assignment. My ProcessService class contains the following code (excerpt only):
@Override
public PersonFormData create(PersonFormData formData) throws ProcessingException {
if (!ACCESS.check(new CreatePersonPermission())) {
throw new VetoException(TEXTS.get("AuthorizationFailed"));
}
SQL.selectInto("SELECT MAX(PERSON_NR)+1 FROM PERSON INTO :personNr", formData);
SQL.insert("INSERT INTO PERSON (PERSON_NR, COMPANY_NR, FIRST_NAME, LAST_NAME, USERNAME, EMAIL, PASSWORD_ENCODED) VALUES (:personNr, :companyNr, :firstName, :lastName, :username, :email, ::passwordEncoded)", formData);
SQL.insert("INSERT INTO USER_ROLE (USER_NR, ROLE_NR) VALUES (:personNr, :{roles})", formData);
return formData;
}
Where formData.roles is a member of AbstractValueFieldData<Set<Long>>
When trying to call create() with a new entry, I get the following error:
INSERT INTO USER_ROLE(USER_NR, ROLE_NR)
VALUES (:personNr, :{roles})
IN :personNr => ? [BIGINT 34] java.lang.IllegalArgumentException: no SqlBind mapping for class java.util.HashSet]
A similar problem occurs when trying to read. The code looks as follows:
@Override
public PersonFormData load(PersonFormData formData) throws ProcessingException {
if (!ACCESS.check(new ReadPersonPermission())) {
throw new VetoException(TEXTS.get("AuthorizationFailed"));
}
StringBuilder statement = new StringBuilder();
statement.append("SELECT FIRST_NAME, LAST_NAME, COMPANY_NR, USERNAME, EMAIL, PASSWORD_ENCODED FROM PERSON WHERE PERSON_NR = :personNr ");
statement.append("INTO :firstName, :lastName, :companyNr, :username, :email, :passwordEncoded");
SQL.selectInto(statement.toString(), formData);
SQL.select("SELECT ROLE_NR FROM USER_ROLE WHERE USER_NR = :personNr INTO :roles", formData); // I've also tried "INTO :{roles}"
return formData;
}
When calling this, I get the following error:
SELECT ROLE_NR
FROM USER_ROLE
WHERE USER_NR = :personNr
INTO :roles
IN :personNr => ? [BIGINT 6]
OUT :roles => ? [Set] / expected a single value for ":roles" but got multiple values ]
I've also tried the "INTO :{roles}" notation but the prolem remains unchanged.
Is this something that has changed in the SQL engine? If so, what changes are needed to make this work again? I have the same issue in other places, always in places where I'm reading multiple values.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04194 seconds