cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table does not gets created for Item Type

Former Member
0 Likes
1,064

Hi expert, just trying to create new item type with deployment table but table does not gets created. it still goes to generic item.

      <itemtype code="SamsungMobile"
         jaloclass="com.hybris.training.core.jalo.SamsungMobile"
         autocreate="true" generate="true">
         **<deployment table="SamsungMobiles" typecode="32122" />**
         <attributes>
             <attribute qualifier="mobileModel" type="java.lang.Long">
                 <modifiers read="true" write="true" optional="false" />
                 <persistence type="property" />
             </attribute>
             <attribute qualifier="shippedQuantity" type="java.lang.Long">
                 <modifiers read="true" write="true" optional="true" />
                 <persistence type="property" />
             </attribute>
         </attributes>
     </itemtype>



SQL query getting generated against FSQ: select * from {SamsungMobile}

SELECT * FROM genericitems item_t0 WHERE (item_t0.TypePkString=? )

Could you please help?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

To move the items of the generic items table, you first have to remove the JNDI row from the table and then do an an clean all followed by system update.

See below link for doing a similar thing when we migrated from 4.8 to 5.0

mansurarisoy
Contributor
0 Likes

If you initially implemented this item without specifying a deployment, it goes to genericitems table and even if you add deployment tag later, it stays in genericitems. There is no automated task to achieve this, but you can achieve this by making some manual arrangements on database. But it looks like you are trying to learn Hybris, therefore, I suggest you to create a new item and from now on don't forget to add deployment tag for items which are extended from GenericItem.

Good luck,
Mansur

Former Member
0 Likes

Do you know if a migration feature is out there for hybris? Sometimes even renaming attributes is a pain.. I think hybris should add this kind of feature that is actually so common

mansurarisoy
Contributor
0 Likes

As far as I know, there is no such migration feature to change attributes of items automatically. You need to handle such migrations manually. My advice is to think twice before adding an attribute to items.xml so that you don't need to change it later 🙂