openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptan <peter_...@hotmail.com>
Subject Re: Convert boolean to String type using ExternalValues
Date Mon, 15 Dec 2008 21:59:10 GMT

Thanks for looking into this. I'm using version 1.2.0.

Here is the schema:
CREATE TABLE testtable (
	id BIGINT NOT NULL AUTO_INCREMENT,
	verified CHAR(10) NOT NULL DEFAULT 'False',
	KEY (id)
)

Entity:

@Entity
@Table(name="testtable")
public class TestTable {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="id")
    private long id;

    @ExternalValues({"true=TRUE", "false=FALSE"})
    @Type(String.class)
    private boolean verified;
}

Test:

    @Test
    public void testcase() {
        em.getTransaction().begin();
        em.persist(new TestTable());
        em.getTransaction().commit();        
    }



Sandhya Kishore wrote:
> 
> Hi Peter,
> 
>     I tested the scenario that you mentioned but it worked fine. Could you
> give me your testcase to reproduce the problem? Pls have a look at my
> simple testcase that I wrote to reproduce the problem. Which version of
> openjpa are you using?
> 
> 
> Thanks
> Sandhya
> 

-- 
View this message in context: http://n2.nabble.com/Convert-boolean-to-String-type-using-ExternalValues-tp1659239p1660187.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message