This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
forked from mareknovotny/jboss-seam
-
Notifications
You must be signed in to change notification settings - Fork 50
/
components.xml
48 lines (38 loc) · 2.19 KB
/
components.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.org/schema/seam/components"
xmlns:core="http://jboss.org/schema/seam/core"
xmlns:fwk="http://jboss.org/schema/seam/framework"
xmlns:persistence="http://jboss.org/schema/seam/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.org/schema/seam/core http://jboss.org/schema/seam/core-2.3.xsd
http://jboss.org/schema/seam/framework http://jboss.org/schema/seam/framework-2.3.xsd
http://jboss.org/schema/seam/persistence http://jboss.org/schema/seam/persistence-2.3.xsd
http://jboss.org/schema/seam/components http://jboss.org/schema/seam/components-2.3.xsd">
<persistence:managed-persistence-context name="entityManager"
persistence-unit-jndi-name="java:/contactlistEntityManagerFactory"/>
<core:init jndi-pattern="${jndiPattern}"/>
<factory name="contact" value="#{contactHome.instance}"/>
<fwk:entity-home name="contactHome"
entity-class="org.jboss.seam.example.contactlist.Contact"/>
<factory name="comment" value="#{commentHome.instance}"/>
<fwk:entity-home name="commentHome"
entity-class="org.jboss.seam.example.contactlist.Comment"
new-instance="#{newComment}"/>
<component name="newComment"
class="org.jboss.seam.example.contactlist.Comment">
<property name="contact">#{contact}</property>
<property name="created">#{currentDatetime}</property>
</component>
<fwk:entity-query name="contacts"
max-results="5">
<fwk:ejbql>select c from Contact c</fwk:ejbql>
<fwk:order>lastName</fwk:order>
<fwk:restrictions>
<value>lower(c.firstName) like lower( concat( #{exampleContact.firstName}, '%' ) )</value>
<value>lower(c.lastName) like lower( concat( #{exampleContact.lastName}, '%' ) )</value>
</fwk:restrictions>
</fwk:entity-query>
<component name="exampleContact"
class="org.jboss.seam.example.contactlist.Contact"/>
</components>