Entity Generation Code