Prepare a bechamel sauce by melting the butter in a small pan. Add the flour, and then the milk, while beating constantly, until the mixture thickens.
Set aside.
In another pan, sauté the onions and garlic in the oil until golden, and add the cabbage. Sprinkle with salt and pepper, and cook for 5 to 8 minutes. Add the apples and stir to coat them well.
Pour the mixture into a baking dish, add the bechamel sauce, cover with a sheet of aluminum foil and bake in the oven approximately 25 minutes. Cook the sausages in the oven at the same time while monitoring the cooking occasionally.
Remove the aluminum foil, add the cheese and broil until brown.