package com.eactive.eai.rms.data.entity.onl.property;

import java.util.Optional;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eactive.eai.data.entity.onl.property.Prop;
import com.eactive.eai.data.entity.onl.property.PropId;
import com.eactive.eai.data.jpa.AbstractDataService;

@Service
@Transactional
public class PropertyService extends AbstractDataService<Prop, PropId, PropRepository> {

	public String getPrpty2valById(String prptyGroupName, String prptyName) {
		Optional<Prop> prop = repository.findById(new PropId(prptyGroupName, prptyName));
		if (prop.isPresent()) {
			return prop.get().getPrpty2val();
		} else {
			return null;
		}
	}

}
