Skip to content

Commit

Permalink
Update code to conform to 2.3 databind
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 18, 2013
1 parent c7b899d commit 1364bc2
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ protected JsonSerializer<Object> findSerializer(SerializerProvider provider, Obj
* this avoids potentially costly lookup from global caches and/or construction
* of new serializers
*/
PropertySerializerMap.SerializerAndMapResult result = _dynamicSerializers.findAndAddSerializer(type,
provider, _property);
/* 18-Oct-2013, tatu: Whether this is for the primary property or secondary is
* really anyone's guess at this point; proxies can exist at any level?
*/
PropertySerializerMap.SerializerAndMapResult result =
_dynamicSerializers.findAndAddPrimarySerializer(type, provider, _property);
if (_dynamicSerializers != result.map) {
_dynamicSerializers = result.map;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public JsonSerializer<?> createContextual(SerializerProvider provider,
BeanProperty property)
throws JsonMappingException
{
JsonSerializer<?> ser = provider.handleContextualization(_serializer, property);

/* 18-Oct-2013, tatu: Whether this is for the primary property or secondary is
* not quite certain; presume primary one for now.
*/
JsonSerializer<?> ser = provider.handlePrimaryContextualization(_serializer, property);

// If we use eager loading, or force it, can just return underlying serializer as is
if (_forceLazyLoading || !usesLazyLoading(property)) {
return ser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ public void setProductCode(String productCode) {
this.productCode = productCode;
}


public boolean equals(Object other) {
@Override
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof OrderDetailId) ) return false;
OrderDetailId castOther = ( OrderDetailId ) other;

return ( (this.getOrderNumber()==castOther.getOrderNumber()) || ( this.getOrderNumber()!=null && castOther.getOrderNumber()!=null && this.getOrderNumber().equals(castOther.getOrderNumber()) ) )
&& ( (this.getProductCode()==castOther.getProductCode()) || ( this.getProductCode()!=null && castOther.getProductCode()!=null && this.getProductCode().equals(castOther.getProductCode()) ) );
&& ( (this.getProductCode()==castOther.getProductCode()) || ( this.getProductCode()!=null && castOther.getProductCode()!=null && this.getProductCode().equals(castOther.getProductCode()) ) );
}

public int hashCode() {
@Override
public int hashCode() {
int result = 17;

result = 37 * result + ( getOrderNumber() == null ? 0 : this.getOrderNumber().hashCode() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,55 @@

@SuppressWarnings("serial")
@Embeddable
public class PaymentId implements java.io.Serializable {


public class PaymentId implements java.io.Serializable
{
private Integer customerNumber;
private String checkNumber;

public PaymentId() {
}
public PaymentId() { }

public PaymentId(Integer customerNumber, String checkNumber) {
this.customerNumber = customerNumber;
this.checkNumber = checkNumber;
}

public PaymentId(Integer customerNumber, String checkNumber) {
this.customerNumber = customerNumber;
this.checkNumber = checkNumber;
}

@Column(name="customerNumber", nullable=false)
public Integer getCustomerNumber() {
return this.customerNumber;
}

public void setCustomerNumber(Integer customerNumber) {
this.customerNumber = customerNumber;
}
@Column(name="customerNumber", nullable=false)
public Integer getCustomerNumber() {
return this.customerNumber;
}

@Column(name="checkNumber", nullable=false, length=50)
public String getCheckNumber() {
return this.checkNumber;
}

public void setCheckNumber(String checkNumber) {
this.checkNumber = checkNumber;
}
public void setCustomerNumber(Integer customerNumber) {
this.customerNumber = customerNumber;
}

@Column(name="checkNumber", nullable=false, length=50)
public String getCheckNumber() {
return this.checkNumber;
}

public void setCheckNumber(String checkNumber) {
this.checkNumber = checkNumber;
}

public boolean equals(Object other) {
@Override
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof PaymentId) ) return false;
PaymentId castOther = ( PaymentId ) other;
if ( (other == null ) ) return false;
if ( !(other instanceof PaymentId) ) return false;
PaymentId castOther = ( PaymentId ) other;

return ( (this.getCustomerNumber()==castOther.getCustomerNumber()) || ( this.getCustomerNumber()!=null && castOther.getCustomerNumber()!=null && this.getCustomerNumber().equals(castOther.getCustomerNumber()) ) )
&& ( (this.getCheckNumber()==castOther.getCheckNumber()) || ( this.getCheckNumber()!=null && castOther.getCheckNumber()!=null && this.getCheckNumber().equals(castOther.getCheckNumber()) ) );
}
return ( (this.getCustomerNumber()==castOther.getCustomerNumber()) || ( this.getCustomerNumber()!=null && castOther.getCustomerNumber()!=null && this.getCustomerNumber().equals(castOther.getCustomerNumber()) ) )
&& ( (this.getCheckNumber()==castOther.getCheckNumber()) || ( this.getCheckNumber()!=null && castOther.getCheckNumber()!=null && this.getCheckNumber().equals(castOther.getCheckNumber()) ) );
}

public int hashCode() {
@Override
public int hashCode() {
int result = 17;

result = 37 * result + ( getCustomerNumber() == null ? 0 : this.getCustomerNumber().hashCode() );
result = 37 * result + ( getCheckNumber() == null ? 0 : this.getCheckNumber().hashCode() );
return result;
}


}


Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ protected JsonSerializer<Object> findSerializer(SerializerProvider provider, Obj
* this avoids potentially costly lookup from global caches and/or construction
* of new serializers
*/
PropertySerializerMap.SerializerAndMapResult result = _dynamicSerializers.findAndAddSerializer(type,
provider, _property);
/* 18-Oct-2013, tatu: Whether this is for the primary property or secondary is
* really anyone's guess at this point; proxies can exist at any level?
*/
PropertySerializerMap.SerializerAndMapResult result =
_dynamicSerializers.findAndAddPrimarySerializer(type, provider, _property);
if (_dynamicSerializers != result.map) {
_dynamicSerializers = result.map;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public JsonSerializer<?> createContextual(SerializerProvider provider,
BeanProperty property)
throws JsonMappingException
{
JsonSerializer<?> ser = provider.handleContextualization(_serializer, property);
/* 18-Oct-2013, tatu: Whether this is for the primary property or secondary is
* not quite certain; presume primary one for now.
*/
JsonSerializer<?> ser = provider.handlePrimaryContextualization(_serializer, property);

// If we use eager loading, or force it, can just return underlying serializer as is
if (_forceLazyLoading || !usesLazyLoading(property)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,25 @@ public void setProductCode(String productCode) {
this.productCode = productCode;
}


public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof OrderDetailId) ) return false;
OrderDetailId castOther = ( OrderDetailId ) other;
return ( (this.getOrderNumber()==castOther.getOrderNumber()) || ( this.getOrderNumber()!=null && castOther.getOrderNumber()!=null && this.getOrderNumber().equals(castOther.getOrderNumber()) ) )
&& ( (this.getProductCode()==castOther.getProductCode()) || ( this.getProductCode()!=null && castOther.getProductCode()!=null && this.getProductCode().equals(castOther.getProductCode()) ) );
}
@Override
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof OrderDetailId) ) return false;
OrderDetailId castOther = ( OrderDetailId ) other;

return ( (this.getOrderNumber()==castOther.getOrderNumber()) || ( this.getOrderNumber()!=null && castOther.getOrderNumber()!=null && this.getOrderNumber().equals(castOther.getOrderNumber()) ) )
&& ( (this.getProductCode()==castOther.getProductCode()) || ( this.getProductCode()!=null && castOther.getProductCode()!=null && this.getProductCode().equals(castOther.getProductCode()) ) );
}

public int hashCode() {
int result = 17;

result = 37 * result + ( getOrderNumber() == null ? 0 : this.getOrderNumber().hashCode() );
result = 37 * result + ( getProductCode() == null ? 0 : this.getProductCode().hashCode() );
return result;
}


@Override
public int hashCode() {
int result = 17;

result = 37 * result + ( getOrderNumber() == null ? 0 : this.getOrderNumber().hashCode() );
result = 37 * result + ( getProductCode() == null ? 0 : this.getProductCode().hashCode() );
return result;
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

@SuppressWarnings("serial")
@Embeddable
public class PaymentId implements java.io.Serializable {
public class PaymentId implements java.io.Serializable
{
private Integer customerNumber;
private String checkNumber;


private Integer customerNumber;
private String checkNumber;

public PaymentId() {
}
public PaymentId() { }

public PaymentId(Integer customerNumber, String checkNumber) {
this.customerNumber = customerNumber;
Expand All @@ -39,26 +37,25 @@ public void setCheckNumber(String checkNumber) {
this.checkNumber = checkNumber;
}


public boolean equals(Object other) {
@Override
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof PaymentId) ) return false;
PaymentId castOther = ( PaymentId ) other;

return ( (this.getCustomerNumber()==castOther.getCustomerNumber()) || ( this.getCustomerNumber()!=null && castOther.getCustomerNumber()!=null && this.getCustomerNumber().equals(castOther.getCustomerNumber()) ) )
&& ( (this.getCheckNumber()==castOther.getCheckNumber()) || ( this.getCheckNumber()!=null && castOther.getCheckNumber()!=null && this.getCheckNumber().equals(castOther.getCheckNumber()) ) );
}

public int hashCode() {
int result = 17;

result = 37 * result + ( getCustomerNumber() == null ? 0 : this.getCustomerNumber().hashCode() );
result = 37 * result + ( getCheckNumber() == null ? 0 : this.getCheckNumber().hashCode() );
return result;
}
&& ( (this.getCheckNumber()==castOther.getCheckNumber()) || ( this.getCheckNumber()!=null && castOther.getCheckNumber()!=null && this.getCheckNumber().equals(castOther.getCheckNumber()) ) );
}

@Override
public int hashCode() {
int result = 17;

result = 37 * result + ( getCustomerNumber() == null ? 0 : this.getCustomerNumber().hashCode() );
result = 37 * result + ( getCheckNumber() == null ? 0 : this.getCheckNumber().hashCode() );
return result;
}
}


0 comments on commit 1364bc2

Please sign in to comment.