In Oracle I have a partitioned table. The partitions are of different sizes and have different data distribution.
I would like to have hibernate issue SQL statements that includes a literal value for the partition key column rather than a bind variable. It should use bind variables for any other values of course.
Using a literal for the partition key will allow Oracle to come up with a plan specific to the known partition and the collected statistics. This might also be useful for columns that have a histogram in place for skewed data.
It would be preferable to specify this in the entity otherwise we will need to do it in each query. Is there a way to do this in hibernate?
We are on hibernate 3.6.1 using the Oracle 10g Dialect.
If there is not a way to do it natively in Hibernate, can I create a user type or dialect or something to make this happen?
No, literal values are not supported in Hibernate. I doubt if you can make a workaround but I guess you're looking for another solution.