To recap, there is an explanation of varargs here, but basically all this feature is, is a way to wrap an array of arguments to be passed to a method.
So in my server I can define a method like this:
...and in the calling code use it like this:
Great so far, but what if I have a number of objects to persist plus an array of variable length that holds more objects to persist? I thought I could do this...
Unfortunately that doesn't work because java interprets that as a call to persist(Object a, Object b).
So how to get around it? Well the only way I could think of was to combine the varargs array and the other array I am passing in. This makes for some messy code before the persist() call so I'm open to other suggestions.