Skip to main content

Create Empty tag in Jaxb2
javax.xml.bind.context.factory = org.eclipse.persistence.jaxb.JAXBContextFactory

package com.infodart.central.integration.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation;
import org.eclipse.persistence.oxm.annotations.XmlNullPolicy;
import com.infodart.central.integration.demo.util.Constants;

@XmlRootElement(name = "WHDEO")
@XmlType(propOrder = { "state", "currencyCode", "email", "country", "orgUnitId", "warehouseId", "warehouseName", "address1", "address2", "city", "pincode", "phoneNumber"})
@Table(name = Constants.TABLE_EBS_WAREHOUSE)
public class EbsWarehouse implements {
private static final long serialVersionUID = -7520690623726202333L;
@Column(name = "ID")
private String id;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "Wh")
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "OrgUnitId")
@Column(name = "ORG_UNIT_ID")
private String orgUnitId;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "WhName")
@Column(name = "WAREHOUSE_NAME")
private String warehouseName;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "CurrencyCode")
@Column(name = "CURRENCY_CODE")
private String currencyCode;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "CountryId")
@Column(name = "COUNTRY")
private String country;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "State")
@Column(name = "STATE")
private String state;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "WhCity", required=true, nillable = true)
@Column(name = "CITY")
private String city;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "WhAdd1")
@Column(name = "ADDRESS1")
private String address1;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "WhAdd2")
@Column(name = "ADDRESS2")
private String address2;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "WhPcode")
@Column(name = "PINCODE")
private String pincode;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@XmlElement(name = "PhoneNum")
@Column(name = "PHONE_NUMBER")
private String phoneNumber;
@XmlNullPolicy(emptyNodeRepresentsNull=true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE)
@Column(name = "EMAIL")
private String email;
@Column(name = "MESSAGE_TYPE")
private String messageType;
@Column(name = "STATUS")
private String status;
public String getId() {
return id;
public void setId(String id) { = id;
public String getWarehouseId() {
return warehouseId;
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
public String getOrgUnitId() {
return orgUnitId;
public void setOrgUnitId(String orgUnitId) {
this.orgUnitId = orgUnitId;
public String getWarehouseName() {
return warehouseName;
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
public String getCurrencyCode() {
return currencyCode;
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
public String getCountry() {
return country;
public void setCountry(String country) { = country;
public String getState() {
return state;
public void setState(String state) {
this.state = state;
public String getCity() {
return city;
public void setCity(String city) { = city;
public String getAddress1() {
return address1;
public void setAddress1(String address1) {
this.address1 = address1;
public String getAddress2() {
return address2;
public void setAddress2(String address2) {
this.address2 = address2;
public String getPincode() {
return pincode;
public void setPincode(String pincode) {
this.pincode = pincode;
public String getPhoneNumber() {
return phoneNumber;
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
public String getEmail() {
return email;
public void setEmail(String email) { = email;
public String getMessageType() {
return messageType;
public void setMessageType(String messageType) {
this.messageType = messageType;
public String getStatus() {
return status;
public void setStatus(String status) {
this.status = status;
public EbsWarehouse() {
public EbsWarehouse(String id, String warehouseId, String orgUnitId, String warehouseName, String currencyCode, String country, String state, String city, String address1, String address2,
String pincode, String phoneNumber, String email, String messageType, String status) {
super(); = id;
this.warehouseId = warehouseId;
this.orgUnitId = orgUnitId;
this.warehouseName = warehouseName;
this.currencyCode = currencyCode; = country;
this.state = state; = city;
this.address1 = address1;
this.address2 = address2;
this.pincode = pincode;
this.phoneNumber = phoneNumber; = email;
this.messageType = messageType;
this.status = status;
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("EbsWarehouse [");
if (id != null)
builder.append("id=").append(id).append(", ");
if (warehouseId != null)
builder.append("warehouseId=").append(warehouseId).append(", ");
if (orgUnitId != null)
builder.append("orgUnitId=").append(orgUnitId).append(", ");
if (warehouseName != null)
builder.append("warehouseName=").append(warehouseName).append(", ");
if (currencyCode != null)
builder.append("currencyCode=").append(currencyCode).append(", ");
if (country != null)
builder.append("country=").append(country).append(", ");
if (state != null)
builder.append("state=").append(state).append(", ");
if (city != null)
builder.append("city=").append(city).append(", ");
if (address1 != null)
builder.append("address1=").append(address1).append(", ");
if (address2 != null)
builder.append("address2=").append(address2).append(", ");
if (pincode != null)
builder.append("pincode=").append(pincode).append(", ");
if (phoneNumber != null)
builder.append("phoneNumber=").append(phoneNumber).append(", ");
if (email != null)
builder.append("email=").append(email).append(", ");
if (messageType != null)
builder.append("messageType=").append(messageType).append(", ");
if (status != null)
return builder.toString();


Popular posts from this blog

Conversion from Clob To String in java and Vice versa

/***reading Clob data from oracle table and setting to Pojo**/
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import oracle.sql.CLOB;


public class MessageDao {
private static String url = "jdbc:oracle:thin:@";
private static String username = "ABC123";
private static String password = "ABC123";

public  List readClobToBO() throws Exception {

Connection conn = DriverManager.getConnection(url, username, password);
PreparedStatement stmt = conn
ResultSet resultSet = stmt.executeQuery();
List msgList= new ArrayList();

while ( {

StagedMessage message = new StagedMessage();


Portable Java 8/ JDK8 setup without admin rights

Some time we got machine to work where we don't have access rights to install anything or if you do not want to install. You can get latest jdk running by this trick. Just follow step step & do comment if you like it.

Step by Step details to get running java from .exe setup without any admin rights. Get portable 7 zip from portableapps.comdownload java 8 from oracle 7 zip & extract jdk-8u102-windows-x64.exeyou will see below folders                .data                .pdata                .rdata                .reloc                .rsrc                .text                CERTIFICATE

          5.Go inside E:\jdk-8u102-windows-x64\.rsrc\1033\JAVA_CAB10you will find 111 file.

         6.extract it it some folder where you can find again extract that to some folder say Java & copy it to very first folder of setup along with .data,.rsrc etc.
         7.Go to folder where you have co…

Multi Threading , Producer consumer problem in Java

Multi threading is topic which is always fascinating for java developer. I feel its more about practical the theory. So here i wanted to present sample examples which clear understanding for several multi threading concept.

In Theory basically thread which is light weight process.Thread shares mostly same memory space.
I said mostly because there is some space called thread local which is not common to threads & separate for each thread. We create thread whenever we wanted to use multicore of processor although that doesn't mean single core cant use it. In single core context switching works among different running thread.

for example suppose there is website which is showing latest price as well as offer as well as doing order booking all these things can be assigned to different thread to provide parallel processing.

There are 2 ways for creating a thread.

Extend a thread & Implement a Runnable class. Extending a class is little avoided since it closed possibility for e…