Version: 1.0.9 beta release

16 views
Skip to first unread message

Otávio Gonçalves de Santana

unread,
Apr 22, 2012, 7:59:30 AM4/22/12
to easy-ca...@googlegroups.com
Version: 1.0.9 beta release

Improvements:

* Supporting at jpa 2.0 annotation
* Query with objects
* Version to retrieve the timestamp of the object
* Using the JPQL



Example code (AlbumServerRest.rar): https://github.com/otaviojava/Easy-Cassandra/downloads



http://weblogs.java.net/blog/otaviojava/archive/2012/04/21/easy-cassandra-109-annotations-jpa-and-jpql


Message has been deleted

Otávio Gonçalves de Santana

unread,
May 11, 2012, 4:06:30 PM5/11/12
to easy-ca...@googlegroups.com
1. How I can refer the rows from Super Class ( Teacher extends
Person ...).If person has an attribute called ID,,,, I want to save
the attributes of Super class, but was not success full.
R: Not implemented yet, but i would fixes bugs about 1.0.9 and in the 1.1.0 version will implement, thank your suggestion it's really nice idea.


2. When I use primitives in the objects, retrieval gave error while
converting to valueOf
R: It's bug, I fixed this and then realise the new version

2012/5/11 Kasun <kasunm...@gmail.com>
Hi Team,

I started to use Easy Cassandra 1.0.8 and moved to 1.0.9-Snapshot. The
JPA implementation is cool. But I was stuck in following scenarios.

1. How I can refer the rows from Super Class ( Teacher extends
Person ...).If person has an attribute called ID,,,, I want to save
the attributes of Super class, but was not success full.

2. When I use primitives in the objects, retrieval gave error while
converting to valueOf

I really appreciate your feed back on this.

Cheers,
Kasun

On Apr 22, 12:59 pm, Otávio Gonçalves de Santana

<otaviopolianasant...@gmail.com> wrote:
> Version: 1.0.9 beta release
>
> Improvements:
>
> * Supporting at jpa 2.0 annotation
> * Query with objects
> * Version to retrieve the timestamp of the object
> * Using the JPQL
>
> Example code (AlbumServerRest.rar
Message has been deleted

Otávio Gonçalves de Santana

unread,
May 11, 2012, 5:02:28 PM5/11/12
to easy-ca...@googlegroups.com
this way, we will bring this resource in this version.
  • Persist with primitive type

2012/5/11 Kasun Mathota <kasunm...@gmail.com>
Thanks for the reply. I am working for EMC (www.emc.com). Our team is using Cassandra  for a new product. We found Easy Cassandra's object mapping is better than Hector. We are using JDK 1.7 Update 4. We are planning to release the first version of the product in another 6 weeks, is there a chance to get 1.1.0 release soon. If not we have to change most of the beans and related classes not to use primitives.  

Cheers,
Kasun
Message has been deleted

Otávio Gonçalves de Santana

unread,
May 11, 2012, 5:54:13 PM5/11/12
to easy-ca...@googlegroups.com
I may commit in the code in github, but I did a lib with this fix, please try this lib.

Sample:
@Entity(name = "primitive")
public class Primitive implements Serializable {

    private static final long serialVersionUID = 3L;
    
    @Id
    private int id;
    
    @Column
    private String typeName;
    
    @Column
    private int integerValue;
    
    @Column
    private float floatValue;
    
    @Column
    private double doubleValue;
    
    @Column
    private long longValue;

    @Column
    private boolean booleanValue;
    
public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getTypeName() {
return typeName;
}

public void setTypeName(String typeName) {
this.typeName = typeName;
}

public int getIntegerValue() {
return integerValue;
}

public void setIntegerValue(int integerValue) {
this.integerValue = integerValue;
}

public float getFloatValue() {
return floatValue;
}

public void setFloatValue(float floatValue) {
this.floatValue = floatValue;
}

public double getDoubleValue() {
return doubleValue;
}

public void setDoubleValue(double doubleValue) {
this.doubleValue = doubleValue;
}

public long getLongValue() {
return longValue;
}

public void setLongValue(long longValue) {
this.longValue = longValue;
}

public boolean getBooleanValue() {
return booleanValue;
}

public void setBooleanValue(boolean booleanValue) {
this.booleanValue = booleanValue;
}
    
    
    
      
}


the Test:

public class PrimitiveDAOTest {

private PersistenceDao<Primitive> dao = new PersistenceDao<>(Primitive.class);
    
    
    @Test
    public void insertTest(){
    Primitive primitive=new Primitive();
    primitive.setId(1);
    primitive.setDoubleValue(1d);
    primitive.setFloatValue(2f);
    primitive.setIntegerValue(2);
    primitive.setLongValue(2l);
    primitive.setBooleanValue(true);
    primitive.setTypeName("integer");
    Assert.assertTrue(dao.insert(primitive));
    }
    
    @Test
    public void retrieveDoubleTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertFalse(primitive.getDoubleValue()==0d);
   
    }
    @Test
    public void retrieveDoubleEqualTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertTrue(primitive.getDoubleValue()==1d);
   
    }
    
    
    @Test
    public void retrieveFloatTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertFalse(primitive.getFloatValue()==0f);
   
    }
    
    @Test
    public void retrieveFloatEqualTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertTrue(primitive.getFloatValue()==2f);
   
    }

    @Test
    public void retrieveIntegerTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertFalse(primitive.getIntegerValue()==0);
   
    }
    @Test
    public void retrieveIntegerEqualTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertTrue(primitive.getIntegerValue()==2);
   
    }
    

    @Test
    public void retrieveLongTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertFalse(primitive.getLongValue()==0);
   
    }
    @Test
    public void retrieveLongEqualTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertTrue(primitive.getLongValue()==2);
   
    }

    @Test
    public void retrievebooleanTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertFalse(!primitive.getBooleanValue());
   
    }
    
    @Test
    public void retrievebooleanEqualTest(){
    Primitive primitive=(Primitive)dao.retrieve(1);
    Assert.assertTrue(primitive.getBooleanValue());
   
    }
    
}
//
Now all test run.
2012/5/11 Kasun Mathota <kasunm...@gmail.com>
Thanks ..I will keep you update with our progress ...
EasyCassandra-1.0.9-RC.jar
Message has been deleted

Otávio Gonçalves de Santana

unread,
May 13, 2012, 8:36:51 AM5/13/12
to easy-ca...@googlegroups.com
Kasun,
can you explain more about your project ?
Maybe, this way we can help better.

2012/5/12 Kasun Mathota <kasunm...@gmail.com>
Hi Otavio,

I will talk to the management on our progress on Monday. Lets keep in touch.

Thank you,
Kasun
Reply all
Reply to author
Forward
0 new messages