Saute diced onion in a pan. Then add the ground meat and simmer under the lid. Add salt and pepper and after 15 minutes, pour the whole can of peeled tomatoes with a juice into the pan.
Add crushed garlic and a spoonful of jam. Stir occasionally during cooking. In the meantime, cook the spaghetti. When the mixture is ready (about 45 minutes), put it on spaghetti and sprinkle with cheese.