This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
forked from hector-client/hector
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to include test case for this
- Loading branch information
Showing
6 changed files
with
145 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
object-mapper/src/test/java/me/prettyprint/hom/beans/MyComposite2PK.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package me.prettyprint.hom.beans; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Used with @IdClass. Properties of this class must match @Id properties | ||
* defined by the entity. | ||
* | ||
* @author B. Todd Burruss | ||
*/ | ||
@SuppressWarnings("serial") | ||
public class MyComposite2PK implements Serializable { | ||
|
||
private String strProp1; | ||
private int intProp1; | ||
|
||
public MyComposite2PK() { | ||
} | ||
|
||
public MyComposite2PK(String strProp1, int intProp1) { | ||
this.intProp1 = intProp1; | ||
this.strProp1 = strProp1; | ||
} | ||
|
||
public int getIntProp1() { | ||
return intProp1; | ||
} | ||
|
||
public void setIntProp1(int intProp1) { | ||
this.intProp1 = intProp1; | ||
} | ||
|
||
public String getStrProp1() { | ||
return strProp1; | ||
} | ||
|
||
public void setStrProp1(String strProp1) { | ||
this.strProp1 = strProp1; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
object-mapper/src/test/java/me/prettyprint/hom/beans/MyCompositeEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package me.prettyprint.hom.beans; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.IdClass; | ||
import javax.persistence.Table; | ||
|
||
import com.mycompany.furniture.Drawer; | ||
|
||
@Entity | ||
@IdClass(MyComposite2PK.class) | ||
@Table(name = "CompositeColumnFamily") | ||
public class MyCompositeEntity { | ||
|
||
@Id | ||
private String strProp1; | ||
|
||
@Id | ||
private int intProp1; | ||
|
||
@Column(name = "strProp2") | ||
private String strProp2; | ||
|
||
@Column(name = "strProp3") | ||
private String strProp3; | ||
|
||
@Column(name = "drawer") | ||
private Drawer drawer; | ||
|
||
public int getIntProp1() { | ||
return intProp1; | ||
} | ||
|
||
public void setIntProp1(int intProp1) { | ||
this.intProp1 = intProp1; | ||
} | ||
|
||
public String getStrProp1() { | ||
return strProp1; | ||
} | ||
|
||
public void setStrProp1(String strProp1) { | ||
this.strProp1 = strProp1; | ||
} | ||
|
||
public String getStrProp2() { | ||
return strProp2; | ||
} | ||
|
||
public void setStrProp2(String strProp2) { | ||
this.strProp2 = strProp2; | ||
} | ||
|
||
public String getStrProp3() { | ||
return strProp3; | ||
} | ||
|
||
public void setStrProp3(String strProp3) { | ||
this.strProp3 = strProp3; | ||
} | ||
|
||
public Drawer getDrawer() { | ||
return drawer; | ||
} | ||
|
||
public void setDrawer(Drawer drawer) { | ||
this.drawer = drawer; | ||
} | ||
|
||
} |