1

In my project I'm using Speedment for ORM. Of course I want my code properly tested. So I decided to create an identical copy of my default database schema which I wanted to use for unit testing. In this case the name of the original schema is "project" and the name of the copy is "test_project"

My problem is that I don't know how to properly address the other database schema.
I know that, upon establishing a connection, I can use the method withSchema("test_project") to tell speedment which schema to use. This works just fine as long as I don't have any columns identifiers in my query.

So this works:

List <User> users = userManager.stream().collect(Collectors.toList());

whereas this doesn't:

List <User> users = userManager.stream().filter(User.UID.equal(id)).collect(Collectors.toList());  

It's telling me this: Unknown column 'project.User.uid' in 'where clause

I don't really understand what's going on there. (Note: I'm quite new to Speedment).
My question is: How can I access my other schema with all its rows properly addressed to it?

1 Answers1

0

This was a bug in Speedment. Changing schema withSchema("test_project") is the correct way. This will be fixed in Speedment version 3.0.23.

janih
  • 2,214
  • 2
  • 18
  • 24