<commit_before>package info.elexis.server.core.connector.elexis.jpa.model.annotated;

import java.time.LocalDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.eclipse.persistence.annotations.Convert;
import org.eclipse.persistence.annotations.Converter;

import info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.ElexisDBStringDateConverter;

@Entity
@Table(name = "TARMED")
public class TarmedLeistung extends AbstractDBObjectIdDeleted {

	@Column(length = 14)
	private String parent;

	@Column(length = 5)
	private String digniQuanti;

	@Column(length = 4)
	private String digniQuali;

	@Column(length = 4)
	private String sparte;

	@Converter(name = "ElexisDBStringDateConverter", converterClass = ElexisDBStringDateConverter.class)
	@Convert("ElexisDBStringDateConverter")
	private LocalDate gueltigVon;

	@Converter(name = "ElexisDBStringDateConverter", converterClass = ElexisDBStringDateConverter.class)
	@Convert("ElexisDBStringDateConverter")
	private LocalDate gueltigBis;

	@Column(length = 25)
	private String nickname;

	@Column(length = 255)
	private String tx255;

	@Column(length = 25)
	private String code;

	@OneToOne
	@JoinColumn(name = "id", insertable = false, updatable = false)
	private TarmedExtension extension;

	@Transient
	public int getAL() {
		Object object = extension.getLimits().get("TP_AL");
		double val;
		try {
			val = Double.parseDouble((String) object);
			return (int) Math.round(val * 100);
		} catch (NumberFormatException nfe) {
			return 0;
		}
	}

	@Transient
	public int getTL() {
		Object object = extension.getLimits().get("TP_TL");
		double val;
		try {
			val = Double.parseDouble((String) object);
			return (int) Math.round(val * 100);
		} catch (NumberFormatException nfe) {
			return 0;
		}
	}

	public boolean requiresSide() {
		Object object = extension.getLimits().get("SEITE");
		if (object != null && Integer.parseInt((String) object) == 1) {
			return true;
		}
		return false;
	}

	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {<commit_msg>Do not chocke on null values for getTL getAL in TarmedLeistung<commit_after>package info.elexis.server.core.connector.elexis.jpa.model.annotated;

import java.time.LocalDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.eclipse.persistence.annotations.Convert;
import org.eclipse.persistence.annotations.Converter;

import info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.ElexisDBStringDateConverter;

@Entity
@Table(name = "TARMED")
public class TarmedLeistung extends AbstractDBObjectIdDeleted {

	@Column(length = 14)
	private String parent;

	@Column(length = 5)
	private String digniQuanti;

	@Column(length = 4)
	private String digniQuali;

	@Column(length = 4)
	private String sparte;

	@Converter(name = "ElexisDBStringDateConverter", converterClass = ElexisDBStringDateConverter.class)
	@Convert("ElexisDBStringDateConverter")
	private LocalDate gueltigVon;

	@Converter(name = "ElexisDBStringDateConverter", converterClass = ElexisDBStringDateConverter.class)
	@Convert("ElexisDBStringDateConverter")
	private LocalDate gueltigBis;

	@Column(length = 25)
	private String nickname;

	@Column(length = 255)
	private String tx255;

	@Column(length = 25)
	private String code;

	@OneToOne
	@JoinColumn(name = "id", insertable = false, updatable = false)
	private TarmedExtension extension;

	@Transient
	public int getAL() {
		Object object = extension.getLimits().get("TP_AL");
		if(object==null) {
			return 0;
		}
		double val;
		try {
			val = Double.parseDouble((String) object);
			return (int) Math.round(val * 100);
		} catch (NumberFormatException nfe) {
			return 0;
		}
	}

	@Transient
	public int getTL() {
		Object object = extension.getLimits().get("TP_TL");
		if(object==null) {
			return 0;
		}
		double val;
		try {
			val = Double.parseDouble((String) object);
			return (int) Math.round(val * 100);
		} catch (NumberFormatException nfe) {
			return 0;
		}
	}

	public boolean requiresSide() {
		Object object = extension.getLimits().get("SEITE");
		if (object != null && Integer.parseInt((String) object) == 1) {
			return true;
		}
		return false;
	}

	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {
{'fraction_non_alphanumeric': 0.11258422082156053, 'fraction_numerical': 0.010867202782003912, 'mean_word_length': 5.063241106719367, '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': '146761', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1488, 'n_words': 336}