package backend;

import models.Text;
import models.Word;

import java.util.List;
import java.util.Map;

/**
 * Created by hlib on 03.10.15.
 */
public class Dao {
    public List<Text> getAllTexts() {
        return Text.findAll();
    }

    public Long getRandomTextId() {
        // call Text method to query random text id
        return 42L;
    }
}

@@ -96,16 +96,41 @@
 til.Map;
+%0Aimport java.util.Random;
 %0A%0A/**%0A *
@@ -182,16 +182,140 @@
 s Dao %7B%0A
+%0A    private final static Long%5B%5D STUB_TEXT_IDS = %7B-592328L, -1049090L, -1618176L%7D;%0A    final Random random = new Random();%0A%0A
     publ
@@ -489,11 +489,160 @@
 urn 
-42L
+getStubTextId();%0A    %7D%0A%0A    private Long getStubTextId() %7B%0A        int index = random.nextInt(STUB_TEXT_IDS.length);%0A        return STUB_TEXT_IDS%5Bindex%5D
 ;%0A  

make getting random text id determined