|
Hibernate example source code file (Swap.java)
The Hibernate Swap.java source codepackage org.hibernate.test.annotations.embedded; import javax.persistence.AttributeOverride; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.Embedded; /** * Interest Rate Swap with Tenor. Used here to compose * a swap spread deal. */ @Embeddable public class Swap { /** * Tenor (duration) of the swap (in years). */ private int tenor; public int getTenor() { return tenor; } public void setTenor(int tenor) { this.tenor = tenor; } /** * Fixed leg (cash flows with the fixed rate). */ private FixedLeg fixedLeg; /** * Floating leg (cash flows bound to a financial index). */ private FloatLeg floatLeg; @Embedded // We retain this annotation to test the precedence of @AttributeOverride // Outermost override annotation should win @AttributeOverride(name = "paymentFrequency", column = @Column(name = "FIXED_FREQENCY")) public FixedLeg getFixedLeg() { return fixedLeg; } public void setFixedLeg(FixedLeg fixedLeg) { this.fixedLeg = fixedLeg; } @Embedded public FloatLeg getFloatLeg() { return floatLeg; } public void setFloatLeg(FloatLeg floatLeg) { this.floatLeg = floatLeg; } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Swap.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.