Need help in association

I want to read a line from file(A) one by one , set to object (B) respectively which should have an association with file object (A) . I want do same thing in Java not in mendix because file (txt file -predefined with spaces and word) has 500 words in one line. Can anyone help to write the java class to do the same thing. I will only pass File (A) object to Java action. Then I want to read line one by one . // BEGIN USER CODE BufferedReader br = new BufferedReader(new InputStreamReader(Core.getFileDocumentContent(getContext(), A))); try { String line; while ((line = br.readLine()) != null) { B .setMessage(line); } } Here whenever it will read new line I want to set to new object B. which should have an association with A i.e file object. Thanks in advannce
1 answers

You need to actually instantiate new B objects. Check out the last example on this page, which both creates objects (newAttachment.create) and sets associations (newAttachment.setAttachment_GenericObject): MX4 Java API Tutorial