sql entity pattern is bad