Whisk flour, baking powder, and salt in a medium bowl. Set aside.
In another large bowl, beat butter and sugar with an electric mixer or stand mixer fitted with the paddle attachment until until creamy and light, about 3 minutes. Add egg and vanilla. Beat again for 2 minutes, stopping to scrape the bottom and sides of the bowl.
Add dry ingredients to the wet ingredients. Mix on low speed just until combined to form a soft dough.
Turn the dough onto a lightly floured piece of parchment paper and gather it into a ball. It will be very soft and sticky, but try not to add more flour. Divide in half. Working with one half of the dough at a time, roll it about ¼-inch thick between two sheets of parchment paper into a disc that is slightly larger than 8 inches. Repeat with the other half of the dough and transfer both discs between their sheets of parchment paper to the fridge for at least 3 hours to chill completely.
Preheat oven to 350°F. Line an 8-inch cake pan a circle of parchment paper and spray with baking spray. Take the dough out of the fridge 10 minutes before shaping so it can warm up a little bit and be more pliable.
Remove one disc of dough from the parchment paper and nestle it into the pan. It should go up the sides a bit, which will help keep the filling contained. Just press the pieces together if they break a bit. Spread the pastry cream or jam onto the dough. Top with the second disc of dough, gently tucking the edges under as best you can, if possible.
Beat the remaining egg with 1 teaspoon cold water to make an egg wash. Brush the top crust with the egg wash using a pastry brush. Score a cross-hatch pattern into the top crust with the tines of a fork.
Bake for 40 to 45 minutes until golden brown. Remove from the oven and cool for 5-10 minutes before turning out onto a wire cooling rack. Flip the cake back over to cool crosshatch side up until it reaches room temperature before slicing and serving. You can also chill the cake and serve it cold.