<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
<BR>I don't see your test class as a peristent class. Unless you add hibernate annotations it won't become as such.<BR>
For the simple class you mentioned, if you are instantiating it and setting it's id, then you should see the correct result.<BR>
Once you implement hibernate, retrieving this object from hibernate's query language should populate id correctly provided id is a not a null field. If you make id as hibernate generated or db generated field then this id field will not be populated unless you persist it first. Hope this helps.<BR>
&nbsp;<BR>
Mahesh<BR>
<BR>&gt; Date: Thu, 21 Feb 2008 17:17:37 +0100<BR>&gt; From: krokodylowy3@wp.pl<BR>&gt; To: rules-users@lists.jboss.org<BR>&gt; Subject: [rules-users] Working witj Hibernate objects<BR>&gt; <BR>&gt; Hi<BR>&gt; <BR>&gt; I'm testing rules with Hibernate objects (classes generated by Eclipse<BR>&gt; JBoss plugin). Do I need any additional annotations in Hibernate class?<BR>&gt; <BR>&gt; <BR>&gt; My simply test fails with "The field testTable.id is not visible" error<BR>&gt; <BR>&gt; my rule: <BR>&gt; <BR>&gt; rule "Init message"<BR>&gt; when<BR>&gt; m : TestTable(id &lt;100) <BR>&gt; (..)<BR>&gt; <BR>&gt; my test class :<BR>&gt; <BR>&gt; public class TestTable implements java.io.Serializable {<BR>&gt; private int id;<BR>&gt; public int getId() {<BR>&gt; return this.id;<BR>&gt; }<BR>&gt; public void setId(int id) {<BR>&gt; this.id = id;<BR>&gt; }(..)<BR>&gt; <BR>&gt; ----------------------------------------------------<BR>&gt; Mucha zaręczyła się z Wojewódzkim?<BR>&gt; http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fzareczyny.html&amp;sid=230<BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; rules-users mailing list<BR>&gt; rules-users@lists.jboss.org<BR>&gt; https://lists.jboss.org/mailman/listinfo/rules-users<BR><BR><br /><hr />It's about getting married. Click here! <a href='http://ss1.richmedia.in/recurl.asp?pid=201' target='_new'>Try it!</a></body>
</html>