Create a record in an object with lookup fields through java soap

I am pretty new with Salesforce and I am doing an integration where I have to update Salesforce with data from a Business System.
I have a problem when trying to create new records in an object with lookup fields from another parent object.
I am using java soap protocol with a partner connection and the field I am trying to update is of Master-Detail type.
I can update it successfully if I enter the Salesforce ID for the value, but not when I enter the actual value that should go in the field.

Using Spring Data JPA with an adjacency matrix stored in a MySQL database

I am new to using Spring Data Jpa but I understand one normally creates a ‘Model’/ ‘Entity’ class in Java that represents a row of data in your database table. This makes sense to me when I have a small table with 3 columns/ class attributes, but what about the case of a table with 100 columns? One hardly creates a ‘Model’ class with 100 attributes? The reason I ask this is because I am storing a large adjacency matrix of train stations in a MySQL database table. I want to interact with this data in my Java Spring application but cannot get my head around how to do this.