<commit_before>package au.gov.amsa.detection.behaviour;

import au.gov.amsa.detection.ArbitraryId;
import au.gov.amsa.detection.model.Context;
import au.gov.amsa.detection.model.Region;
import au.gov.amsa.detection.model.SimpleRegion;
import au.gov.amsa.detection.model.SimpleRegion.Behaviour;
import au.gov.amsa.detection.model.SimpleRegion.Events.Create;

public class SimpleRegionBehaviour implements Behaviour {

    private final SimpleRegion self;

    public SimpleRegionBehaviour(SimpleRegion self) {
        this.self = self;
    }

    @Override
    public void onEntryCreated(Create event) {
        self.setId(ArbitraryId.next());
        self.setZippedShapefileBytes("B64 encoded zip archive bytes");
        Region region = Region.create(ArbitraryId.next());
        region.setName(event.getName());
        region.setDescription(event.getDescription());
        region.setSimpleRegion_R4(self);
        region.setState(Region.State.CREATED.name());
        Context.em().persist(region);
        self.setRegion_R4(region);
    }

}<commit_msg>set other side of relationship R5<commit_after>package au.gov.amsa.detection.behaviour;

import au.gov.amsa.detection.ArbitraryId;
import au.gov.amsa.detection.model.Context;
import au.gov.amsa.detection.model.Region;
import au.gov.amsa.detection.model.SimpleRegion;
import au.gov.amsa.detection.model.SimpleRegion.Behaviour;
import au.gov.amsa.detection.model.SimpleRegion.Events.Create;

public class SimpleRegionBehaviour implements Behaviour {

    private final SimpleRegion self;

    public SimpleRegionBehaviour(SimpleRegion self) {
        this.self = self;
    }

    @Override
    public void onEntryCreated(Create event) {
        self.setId(ArbitraryId.next());
        self.setZippedShapefileBytes("B64 encoded zip archive bytes");
        Region region = Region.create(ArbitraryId.next());
        region.setName(event.getName());
        region.setDescription(event.getDescription());
        region.setSimpleRegion_R4(self);
        region.setState(Region.State.CREATED.name());
        Context.em().persist(region);
        self.setRegion_R4(region);
        region.setSimpleRegion_R4(self);
    }

}
{'fraction_non_alphanumeric': 0.11218390804597701, 'fraction_numerical': 0.004597701149425287, 'mean_word_length': 3.79295154185022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1567083', 'n_tokens_mistral': 678, 'n_tokens_neox': 642, 'n_words': 102}