cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert a new data in Hybris/Oracle DB?

Former Member
0 Kudos

Hi All,

I'm new to Hybris environment and currently i want to have the functionality to store the user mail id in database.

Can I have a help on this or please provide me tips to finish this.

Regards, Khaja

Funtinality I need:

1)User clicks on downloading link 2)Popup comes and asks user to provide his/her mail id to proceed further 3)Once user provided his mailid automatically document can be downloaded from HMC.

I have done with UI pnd created document in HMC also. How do i store mail id here?

I wanna store mail id in DB.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

You should really do the trails if you haven't already, they don't cover absolutely everything in Hybris, but will give you an understanding of what makes Hybris tick, as well as a go to reference guide in case you forget any of the basics.

Start with the core trails here, even if its just to refresh your memory. To complete the piece of work, I would recommend that you definitely look at this part of the core trails, which will help to give you a basic understanding of the data model concept. I would then check the section "Adding Types and Attributes" from this resource to understand how to take an existing model and add new attributes.

One thing I will point out though; the CustomerModel has a contactEmail attribute already, so perhaps you could use that if this functionality is exposed to a customer? Otherwise you will more than likely need to create a new item that extends the user model with your custom attributes, or extend the existing user model (I'd do the former, because the customer model extends the user model, and therefore could end up with two email attributes, which would be redundant)

Former Member
0 Kudos

Short comment: The contact email is not the persited property. I decided to query all customers using FlexibleSearch, where I could filter them by email, and I found out that this attribute cannot be used in the FS query. Usually, ID can contain emails, but this is a different story.

I would assume that it is cleaner to make a "better" customer model implementation and iherit everything from CustomerModel.

Former Member
0 Kudos

I agree that's a feasible idea, but without full scope of what's been tried I guess we're merely speculating on a solution, which is probably why this question was closed as its not that constructive.

Former Member
0 Kudos

Saurabh, AS Dobbs mentioned go thru Hybris Trails. Which gives you clear idea what exactly you need to proceed with code changes..

Secondly, as you added a new attribute in your items.xml. Run the hybris update the project where u added new element/attribute. This create a column in the database table. Then using ModelService you can update/save that value into database. Hope this helps.

Former Member
0 Kudos

First thing you need to do is jump on a training course and do the dev trails on the wiki.

Former Member
0 Kudos

Crete a new attribute in your items xml file for the item your mail id belongs. And in the backend set the item object using modelService.save

Former Member
0 Kudos

Hi Saurabh,

I already created a new attribute in items.xml file. confused from here. Thanks for your response.

Regards, Khaja