Using a java snipet simple to pass flow variables

I have been using a Java snipet to retain a flow variable that is not queried/returned by a database query.  In order to pass a variable from a component previous to a database reader I place a java snipet after the variable to table component which follows the database reader component.  The following is the series of events:  xsl reader retrieves keys from xls file, then xls reader is connected as input to a loop start component which is connected as input to a database reader.  The database output is connected as input to a variable to table component. This component is attached to a loop end.  This query returns many columns/fields/variables.  Afterwards I connect another table row to variable loop components and query another table using some of the fields returned by the previous query  This second query returns new fields.  The fields returned by the database query can be passed along to the next component; but in order to pass the input fields along the workflow (all the fields that were returned by the first query), I have to use a java snipet.  So, I connect a java snipet to the output of the variable to table component that follows the second database reader, and the java snipet is connected to a loop end. The java snipet returns the variable; for example, return variable name.  These component returns the field and adds the column to the output table together with the records returned by the second database reader.

What I would like to know is the following:

 

If the two queried tables are 1:1 related, is it guarantied that the output from one table is linked to the output of the other table with the same 1:1 relationship?  In other words, are the two outputs related by matching on key field?

On the other hand,  if the tables are 1: to many related, will the outputs be linked by matching on 1: many key field so that if one key produces many matches the matches will appear all with their on matched key?

Thanks,

Giuseppa