Trouble after updating to nightly Luna build [message #1268249] |
Mon, 10 March 2014 04:46  |
Eclipse User |
|
|
|
In order to test various bugs that I have created and that were recently fixed, I have updated both my SDK and my target to the Luna nightly build of 2013-03-10.
This has broken a lot of my code, the most prominent being Class[] -> List<Class> changes, which I have now adjusted. However, there are a few compile errors that I have been unable to easily resolve.
I've checked the following two resources:
- NewAndNoteworthy/4.0
- Bug List
but not found the answers to my problems.
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.
These are the issues I've so far been unable to resolve:
- 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?
- in two places I've been creating instances of SwtScoutAction() which seems to have disappeared. How do I replace these?
|
|
|
Re: Trouble after updating to nightly Luna build [message #1268262 is a reply to message #1268249] |
Mon, 10 March 2014 05:14   |
Eclipse User |
|
|
|
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 05:28] by Moderator
|
|
|
|
|
|
|
|
|
Re: Trouble after updating to nightly Luna build [message #1273119 is a reply to message #1270857] |
Wed, 19 March 2014 10:46   |
Eclipse User |
|
|
|
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.23031 seconds