JavaBeans:
JavaBean is a Java class that:
1. Implements the Serializable
interface
2. Has a no-argument
constructor
3. JavaBean properties must
have public setter and getter methods
Java
Bean makes it easy to reuse software components.
Example of JavaBean:
public class JavaBeanDemo implements java.io.Serializable
{
private int num;
private String
Fname;
public JavaBeanDemo()
{
// default constructor
}
public void setNum(final int num)
{
this.num
= num;
}
public int getNum()
{
return num;
}
public void setFname(final String
Fname)
{
this.Fname
= Fname;
}
public String
getFname()
{
return Fname;
}
}
JavaBean in Hybris:
- In hybris javabeans are automatically generated.
- Each extension may provide a bean configuration file in this file class name, attributes or superclass are defined.
- Java Beans or Enums definitions are melded across extensions.
- Java beans Contain an abstraction of models.
Example for custom java bean Generating:
Configure
the bean in extension-beans.xml
<bean
class="com.hybrisdemo.data.JavaBeanDemo">
<property name="num"
type="int"/>
<property
name="Fname" type="String"/>
</bean>
The
following JavaBean is Generated under platform/bootstrap/gensrc folder based on
above configuration. it generated when ever we call “ant all” ( or)
“ant clean all” target.
public class JavaBeanDemo implements java.io.Serializable
{
private int num;
private String Fname;
public JavaBeanDemo()
{
// default constructor
}
//Setters and getters methods..
}
- Java beans are useful as DataObjects used by Frontend layer.
- Merge attributes into existing beans.
For example:- extenstion1 and extenstion2 have
same bean class with different attributes that attributes merge into one
javabean class Generated under platform/bootstrap/gensrc.
extension1-beans.xml:-
<bean
class="com.hybrisdemo.data.JavaBeanDemo">
<property name="num"
type="int"/>
<property name="Fname" type="String"/>
</bean>
extension2-beans.xml:-
<bean
class="com.hybrisdemo.data.JavaBeanDemo">
<property name="num"
type="int"/>
<property name="Fname" type="String"/>
<property name=”Lname” type=”String”/>
</bean>
Generated JavaBean Class:-
public class JavaBeanDemo implements java.io.Serializable
{
private int num;
private String Fname;
private String Lname;
public JavaBeanDemo()
{
//
default constructor
}
public void setNum(final int num)
{
this.num = num;
}
public int getNum()
{
return num;
}
public void setFname(final String
Fname)
{
this.Fname = Fname;
}
public String
getFname()
{
return Fname;
}
public void setLname(final String
Lname)
{
this.Lname = Lname;
}
public String
getLname()
{
return Lname;
}
}
Very Good Blog if someone need any help in technological things please visit our blog page
ReplyDeletegreat
ReplyDeleteI believe there are many more pleasurable opportunities ahead for individuals that looked at your site. Technically storng. Best Java Training Institute Chennai
ReplyDeleteGreat stuff!! Keep doing and I would like to share with my friends
ReplyDeleteSelenium Training in Chennai
Best Selenium Training Institute in Chennai
ios developer training in chennai
Digital Marketing Training in Chennai
.Net coaching centre in chennai
Salesforce Training institutes in Chennai
Salesforce Course in Chennai
Big Data Training in Chennai
Thanks for sharing. Valuable blog
ReplyDeleteDigital Marketing Company in Pune
SEO Company in Pune
Mobile app development company in Pune
Website Development Company in Pune
Mobile Game Development Company in Pune
Software Development Company in Pune
Thanks for chosing my most favourite topic in java.This is nice info .THanks that u have explained in a very simple manner.
ReplyDeleteiphone service centre
ipad service center in chennai
ipad service center
apple mobile service centre in chennai
iphone service centre chennai
Hi, thank you very much for the new information, i learned something new. Very well written. Keep posting article. If you are looking for any data science related information please visit our website data science course training bangalore
ReplyDeleteThanks for sharing useful information on big data and Hadoop technology. Hadoop and Bigdata are going to be future of the computing world in the coming years. This field is a very good option that provides huge offers as career prospects for beginners and talented professionals. Taking a course from bigdata training institute in bangalore will help you to start a good career in big data technology.
ReplyDeleteAmazing and informative post,
ReplyDeleteThanks for sharing with us,
We are again come on your website,
Thanks and good day,
If you need any logo then,
Please visit our site,
buylogo
Thanks for sharing this type of blog i really like it please keep sharing such useful information.
ReplyDeleteUnderstanding Lifecycle in Android Activity
"NICE
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Thanks for sharing the information. It is very useful for my future. keep sharing.
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
Hello.
ReplyDeleteAre you looking for a amazing logo design for your business with 50% off I expect You will be impressed with us.Logo Designers
hbar coin hangi borsada
ReplyDeletebtcst coin hangi borsada
vet coin hangi borsada
via coin hangi borsada
tron hangi borsada
juventus coin hangi borsada
beta coin hangi borsada
auto coin hangi borsada
mtl coin hangi borsada
MMORPG
ReplyDeleteInstagram takipçi satın al
Tiktok Jeton Hilesi
tiktok jeton hilesi
Saç ekim antalya
takipci satin al
instagram takipçi satın al
metin2 pvp serverler
İNSTAGRAM TAKİPCİ
perde modelleri
ReplyDeletesms onay
Türk Telekom Mobil Ödeme Bozdurma
HTTPS://NFTNASİLALİNİR.COM
ankara evden eve nakliyat
trafik sigortası
dedektor
KURMA.WEBSİTE
ask romanlari
Good content. You write beautiful things.
ReplyDeletesportsbet
mrbahis
sportsbet
hacklink
vbet
korsan taksi
hacklink
mrbahis
vbet
Good text Write good content success. Thank you
ReplyDeletebetmatik
bonus veren siteler
betpark
poker siteleri
kibris bahis siteleri
tipobet
slot siteleri
kralbet