[Persistence, JBoss/CMP, Hibernate, Database] - Re: JPQL:
by ethnarch
I would go look this up for you normally but I can't find the documentation on hibernate right now.
I think HQL might have a mod operator and I think this is what you actually want to use. I can't verify it it really exists though.
The mod operator returns the remainder so 5 mod 2 = 1 and 3 mod 2 = 1
So you would look for anything (s.age mod 10)=:age to find any ages that end in a certain number.
Most databases that I know of have some form of the mod operator for instance sql server
http://www.tek-tips.com/viewthread.cfm?qid=1213610&page=10
and oracle
http://www.techonthenet.com/oracle/functions/mod.php
If it does exist then you would be able to do something like this
SELECT s FROM Student s WHERE mod(s.age,10)=:age
I suspect that this would be faster than a string comparison and conversion however, I am not sure either.
Actually I think i found some documentation half way down this page
http://doc.javanb.com/hibernate-reference-3-2-4-sp1-en/queryhql.html
anonymous wrote : Any function or operator defined by EJB-QL 3.0: substring(), trim(), lower(), upper(), length(), locate(), abs(), sqrt(), bit_length(), mod()
There is always more than one way to do things but hopefully this helps you.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226275#4226275
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226275
17 years, 2 months
[JBoss Portal] - Re: How to set empty renders for portlets
by dvanwest
We typically indicate the empty renderer in the page description file portal-object.xml. Not sure this approach will meet your needs.
| <window>
| <window-name>Intro</window-name>
| <instance-ref>introInstance</instance-ref>
| <region>top</region>
| <height>2</height>
| <properties>
| <property>
| <name>theme.renderSetId</name>
| <value>emptyRenderer</value>
| </property>
| </properties>
| </window>
|
As for preventing drag & drop for windows within a specific region... we modified the dyna.js file to remove the drag & drop hooks for any window regions within an enclosing div which has a special class name we use to indicate the region shouldn't allow drag or drop activity. We add the special class name to a region in the layout JSP.
Maybe others have a better solution?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226260#4226260
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226260
17 years, 2 months