I have a column set up of id, item_id, logo and imagetype. Now I want to add a isDefault value that is used to get the first image for an item. An item can have many images but only one default per imagetype.
itemId and imagetype together can only have one isDefault set to 1 the rest should be o for isDefault. Is there anyway of doing this with Hibernate? This is what I got so far.
posted 9 years ago
I'm not sure whether this will solve your problem.
To set default value to a column , I had done like this before.
<property name="price" type="string" formula="CASE WHEN (COALESCE(ITEM_CST,0) = 0) THEN ' ' ELSE CHAR(ITEM_CST) END"/>