I need to send collection to this method:
public boolean[] save(T... entities) {
return _saveOrUpdateIsNew(entities);
}
and I tried to pass the collection:
List<Client> clientsToUpdate = new ArrayList<Client>();
save(clientsToUpdate );
but I get a compilation error that the method type is not applicable for List<Client>
EDITED:
After I added the line:
clientsToUpdate.toArray(new Client[0]);
I have this compilation error:
The method save(Client...) in the type BaseDAO<Client,Integer> is not applicable for the arguments (Client[])
The method you mentioned is using varargs, it means it accepts a single
Clientinstance or an array ofClientobjects. You should convert yourListto array like this:This should work unless you have multiple
Clientclasses in your project.