--- layout: archive title: Zulip Chat Archive permalink: /stream/116395-maths/topic/hello.html ---
Welcome to #maffs.
Description: mathlib / maths
is this better?
No. I would have no idea what "maffs" means if I hadn't seen Sebastian question
it's a meme
Kenny, did you create it yourself?
yes
I thought only admins could do that
I vote you rename it to math
It's less specific than mathlib
I'm afraid I can't rename it
What about deleting it?
I can't do it either
From https://www.urbandictionary.com/define.php?term=Maffs it seems you need to have been a student in an English speaking country to understand this word
@Sebastian Ullrich Can you delete this stream?
I renamed it. Do tell me if you decide on a different name.
oh for god's sake
it's called maths :P
Okay okay, I'll trust the native speaker :P
I'm not a native speaker lol
Now we can bikeshed about maths vs math forever.
yes we can
maybe "math(s)"?
@Moses Schönfinkel will be happy
the nativer speaker...?
confirmed ™
The bikesheder
math(ε|s)
maths?
Although this whole chat sometimes gets frivolous, I think "maffs" is taking a bit too far. I don't care either way between maths (UK English) and math (US English) but either of them are infinitely preferable to the meme IMO.
long live meme
w
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


England 12-32 South Africa: Red Rose submit to Springboks' power in Rugby World Cup Final
Eddie Jones' men couldn't repeat their semi-final hammering of the All Blacks, and were convincingly beaten in Yokohama
by Alex Spink, https://www.facebook.com/alexspinkmirror/England's World Cup dream died a brutal death in Japan as South Africa powered to their third title in emphatic fashion.
Favourites to repeat their hammering of the All Blacks, England instead ran into the irresistible power of the Springboks, who battered them into submission.
Wales boss Warren Gatland had wondered out loud in the week whether England had played their final in the semi-final and so it proved.
Second half tries by Bok wings Makazole Mapimpi and Cheslin Kolbe, and 22 points from the boot of Handre Pollard, left Eddie Jones' men with only tears for souvenirs.
“I don't know where this has come from,” said 2003 winner Matt Dawson on BBC 5 live. “It's come from the gods. Their defensive line, their line speed, their discipline, their energy, has been simply fantastic.
“England have no answer. An amazing performance from a Springbok team who everybody wrote off.
"A royal thrashing of England in the World Cup final.”
England had known what was coming but knowing and dealing with the sort of uplift in physical brutality brought by the Boks are two different things.
Losing tighthead prop Kyle Sinckler to concussion after a freak collision with Maro Itoje’s elbow less than three minutes int the contest set the tone for a quite horrible first half.
You had to admire what South Africa brought to the party. They had made no secret of their team selection long before they announced it.
There was no pretence about what their tactics would be, route one and hard as you like into every collision.
They simply did what the Springboks do and in Pollard had a goal kicker in a rich vein of form to take full advantage.
Perhaps it would have been different had not Sinckler gone to tackle jack-in-a-Boks wing Makazole Mapimpi and been knocked sparko.
England were already on the back foot due to the way Rassie Erasmus’ side had bolted out of the traps at the first whistle.
But losing their young star and having to readjust to the ways of replacement Dan Cole so early unsettled them more than can ever have been expected of a side which had battered the All Blacks.
As the intensity continued to crack up England’s composure started to fracture. Passes were knocked on, kicking from hand became inaccurate and the penalties at scrum time started to rack up.
The bad luck was not solely England’s preserve as South Africa lost Mbongeni Mbonambi and Lood de Jager in the same move on 22 minutes.
But their set-piece superiority was unaffected and despite two Farrell penalties, England were frustrated on their only foray into the enemy red zone by watertight Bok defence.
From there it was all Erasmus’ team as Pollard kicked four goals to put his side 12-6 ahead at the break - significant as no side had ever won the World Cup when trailing at the midpoint.
No change with the new half despite South Africa surprisingly changing both props barely four minutes after the restart. The new models picked up where they had left off.
England had to do something and Jones, having replaced Courtney Lawes with the greater bulk of George Kruis at the break, sacrificed the carrying of Mako Vunipola for the tight work of Joe Marler.
It worked a treat as England ploughed through the South African scrum at the first attempt and when Farrell kicked the penalty the men in white, improbably, were back to within a score.
Now they had to score the next points but they could not. And despite Farrell levelling Pollard’s kick the decisive moment was at hand.
South Africa attacked down the narrow side Mapimpi kicked ahead for Lukhanyo Am to gather and the centre then flipped the ball over his shoulder and back into the wing's hands for a splendid score.
Referee Jerome Garces checked for a forward pass but the try stood and England were cut adrift at 12-25.
Worse was to follow. South Africa came again, this time down the right. Kolbe got the ball, danced round four forwards and then left Farrell clutching at thin air.
It was emblematic of the game.
The Boks were simply too good and as the final whistle put England out of their misery, Siya Kolisi became the first black captain ever to lift the World Cup,
England
Pens: Farrell 4.
South Africa
Tries: Kolbe, Mapimpi.
Cons: Pollard 2.
Pens: Pollard 6.


Preparation time
30 mins to 1 hour
Cooking time
30 mins to 1 hour
Serves
Serves 8
Dietary
This wonderful tart brings together crisp pastry and butterscotch-tasting almonds.
For this recipe you will need a loose-bottomed 24cm/9½in fluted tart tin.
Preheat the oven to 190C/170C Fan/Gas 5. For the pastry, put the flour, butter and sugar together in a food processor and blitz until they resemble breadcrumbs. Add the egg yolk and 2 tsp cold water and mix until the dough comes together. Roll out on a floured worktop to a thickness of 5mm, a little bit bigger than the base of a 24cm/9½in fluted tart tin.
 Cover with cling film and leave in the fridge for at least 30 minutes.
Remove the cling film and prick the pastry base all over lightly with a fork. Line with baking paper and tip in baking beans or lentils. Bake for 15 minutes. Remove the baking beans and paper and return to the oven for 3–4 minutes to dry out the base without colouring.
To make the filling, toast the almonds in a dry frying pan over medium-high heat for 2–3 minutes, until light golden-brown, keeping a close eye on them. Tip them into a bowl.
Put the butter, sugar and milk in the frying pan over medium heat. When the sugar has dissolved and the butter melted, bring to the boil and boil for 1 minute. Add the almonds and mix well before turning into the pastry case.
Bake for 15–20 minutes, until rich golden-brown. Remove from the oven and leave to cool. Serve warm or cold.


| Global Routing Operations | J. Snijders |
| Internet-Draft | NTT |
| Intended status: Informational | M. Stucchi |
| Expires: September 6, 2019 | RIPE NCC |
| March 5, 2019 |
RPKI Autonomous Systems Cones: A Profile To Define Sets of Autonomous Systems Numbers To Facilitate BGP Filtering
draft-ietf-grow-rpki-as-cones-01
This document describes a way to define groups of Autonomous System numbers in RPKI [RFC6480]. We call them AS-Cones. AS-Cones provide a mechanism to be used by operators for filtering BGP-4 [RFC4271] announcements.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 6, 2019.
Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
The main goal of the Resource Public Key Infrastructure (RPKI) system [RFC6480] is to support improved security for the global routing system. This is achieved through the use of information stored in a distributed repository system comprised of signed objects. A commonly used object type is the Route Object Authorisation (ROAs), which describe the prefixes originated by ASNs.
There is however no way for an operator to assert the routes for its customer networks, making it difficult to use the information carried by RPKI to create meaningful BGP-4 filters without relying on RPSL [RFC2622] as-sets.
This memo introduces a new attestation object, called an AS-Cone. An AS-Cone is a digitally signed object with the goal to enable operators to define a set of customers that can be found as "right adjacencies", or transit customer networks, facilitating the construction of prefix filters for a given ASN, thus making routing more secure.
AS-Cones are composed of two types of distinct objects:
These objects are stored in ASN.1 format and are digitally signed according to the same rules and conventions applied for RPKI ROA Objects ([RFC6482]).
A policy definition contains a list the upstream and peering relationships for a given Autonomous System that need an AS-Cone to be used for filtering. For each relationship, an AS-Cone is referenced to indicate which BGP networks will be announced to the other end of the relationship.
The default behaviour for a neighbour, if the relationship is not explicitly described in the policy, is to only accept the networks originated by the ASN. This means that a stub ASN neither has to set up any AS-Cone, description, nor policy.
Only one AS-Cone can be supplied for a given relationship. If more than one AS-Cone needs to be announced in the relationship, then it is mandatory to create a third AS-Cone that includes those two.
A Policy object is referenced using the Autonomous System number it refers to, preceded by the string "AS".
ASNPolicy DEFINITIONS ::= BEGIN Neighbours ::= SEQUENCE OF Neighbour Neighbour ::= SEQUENCE { ASN INTEGER (1..42949672965), ASCone VisibleString } Version ::= INTEGER LastModified ::= GeneralizedTime Created ::= GeneralizedTime END
ASN.1 format of a Policy definition object
When referring to a neighbour relationship contained in a Policy definition object the following convention should be used:
ASX:ASY
Where X is the number of the AS holder and Y is the number of the ASN intended to use the AS-Cone object to generate a filter.
An AS-Cone contains a list of the downstream customers and AS-Cones of a given ASN. The list is used to create filter lists by the networks providing transit or a peering relationship with the ASN.
An AS-Cone can reference another AS-Cone if a customer of the operator also has defined an AS-Cone to be announced upstream.
AS-Cones MUST have a unique name for the ASN they belong to. Names are composed of ASCII strings up to 255 characters long and cannot contain spaces.
In order for AS-Cones to be unique in the global routing system, their string name is preceded by the AS number of the ASN they are part of, followed by ":". For example, AS-Cone "EuropeanCustomers" for ASN 65530 is represented as "AS65530:EuropeanCustomers" when referenced from a third party.
ASCone DEFINITIONS ::= BEGIN Entities ::= SEQUENCE OF Entity Entity CHOICE { ASN INTEGER (1..4294967295), OtherASCone VisibleString } Version ::= INTEGER LastModified ::= GeneralizedTime Created ::= GeneralizedTime END
ASN.1 format of an AS-Cone
The goal of AS-Cones is to be able to recursively define all the originating ASNs that define the customer base of a given ASN, including all the transit relationships. This means that through AS-Cones, it is possible to create a graph of all the neighbour relationships for the customers of a given ASN.
In order to validate a full AS-Cone, a network operator MUST have access to the validated cache of an RPKI validator software containing all the Policy definition and AS-Cone objects. Validation occurs following the description in: [RFC6488].
In order to validate a full AS-Cone, an operator SHOULD perform the following steps:
If none of the two objects above exists, then the operator should only consider the ASN of its downstream to be added to the list.
Since the goal is to build a list of ASNs announcing routes in the AS-Cone, then if an ASN or an AS-Cone are referenced more than once in the process, their contents should only be added once to the list. This is intended to avoid endless loops, and in order to avoid cross-reference of AS-Cones.
When an operator is a member of an internet exchange point, it is recommended for it to create at least a Default policy.
In case of a peering session with a route server, the operator could publish a policy pointing to the ASN of the route server. A route server operator, then, could build strict prefix filtering rules for all the participants, and offer it as a service to its members.
AS-Cones are very similar to AS-Set RPSL Objects, so they could also be published in IRR Databases as AS-Set objects. Every ASN contained in an AS-Cone, and all the AS-Cones referenced should be considered as member: attributes. The naming convention for AS-Cones (ASX:AS-Cone) should be maintained, in order to keep consistency between the two databases.
TBW
This memo includes no request to IANA.
The following people contributed significantly to the content of the document: Greg Skinner.
The authors would like to thank ...
| [RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
| [RFC4271] | Rekhter, Y., Li, T. and S. Hares, "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, DOI 10.17487/RFC4271, January 2006. |
| [RFC8174] | Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. |
| [RFC2622] | Alaettinoglu, C., Villamizar, C., Gerich, E., Kessens, D., Meyer, D., Bates, T., Karrenberg, D. and M. Terpstra, "Routing Policy Specification Language (RPSL)", RFC 2622, DOI 10.17487/RFC2622, June 1999. |
| [RFC6480] | Lepinski, M. and S. Kent, "An Infrastructure to Support Secure Internet Routing", RFC 6480, DOI 10.17487/RFC6480, February 2012. |
| [RFC6482] | Lepinski, M., Kent, S. and D. Kong, "A Profile for Route Origin Authorizations (ROAs)", RFC 6482, DOI 10.17487/RFC6482, February 2012. |
| [RFC6488] | Lepinski, M., Chi, A. and S. Kent, "Signed Object Template for the Resource Public Key Infrastructure (RPKI)", RFC 6488, DOI 10.17487/RFC6488, February 2012. |


You are Exploring the Evil Lair when suddenly you hear footsteps approaching. What should you do? You look around and notice that suit of armor by the door. Voila, wouldn't that make for a great hiding spot?
This trope covers any instance where a mounted knight's armor is used by a character for camouflage. Owes a lot to Rule of Funny given how long it would take for a single person to put on the armor. note
Compare Nobody Here but Us Statues when a character hides in plain sight by pretending to be a statue or similar. See Animated Armor where a soul inhabits an empty suit of armor.
Examples:
- On at least one occasion each in Fullmetal Alchemist, Mei, Mei's panda, Winry, and a cat is hidden inside Al's armor.
- In the first season of Yu-Gi-Oh!, Tristan hid from Pegasus' guards in one of the suits of armor decorating his castle.
- In Mobile Suit Gundam: The Origin, during the flashback arc an assassin sent by the Zabi family sneaks into Don Mass' mansion this way and manages to kill Jinba Ral and cripple Don Mass before being defeated in a particularly brutal fashion in a sword fight with a young Char. Notably, in the manga's version of the battle of A Baoa Qu, Char begins having flashbacks to this incident while fighting Amuro in a treasure room full of suits of historic armor belonging to Ghiren Zabi.
- Tintin:
- In Tintin in America, Tintin sneaks into the castle where the members of the KIDNAP Inc. meet. He hides inside a knight's armor in the corridor and takes out one unsuspecting baddie after the other as they pass by.
- Subverted in Tintin: The Secret of the Unicorn. Tintin is trying to escape the Bird brothers in their antique-filled basement. Cut to the villains arriving and seeing a suit of armour standing in the corner. They suspect Tintin inside it and fire at it. It falls apart. Turns out, Tintin hid behind a desk.
- In the Scrooge McDuck story The Black Knight, Gentleman Thief Arpin Lusene hides in a suit of armor when Scrooge and Donald burst into the room Lusene is currently in looking for him. He then keeps moving around when they're not paying attention and eventually escapes with the armor. This becomes plot-relevant later, since he uses the stolen armor to create the Black Knight by coating it with the Omnisolve.
- Bill & Ted's Excellent Adventure:
- The titular duo dress in suits of armor off-screen while in medieval England. It's implied they somehow slipped into them as they comment on their first steps that it's really heavy.
Ted: Heavy metal!
[air guitar] - To really play this up, Ted falls down a set of stairs and somehow falls out of the suit while leaving the suit in a perfectly intact shape.
- The titular duo dress in suits of armor off-screen while in medieval England. It's implied they somehow slipped into them as they comment on their first steps that it's really heavy.
- The titular character in Johnny English Strikes Again performs exactly as pictured above. Because of Clingy Costume, he isn't able to remove it until he knocks out the Big Bad and is finally congratulated by the Prime minister.
- In French comedy La Tour Montparnasse Infernale, Eric and Ramzi are window washers trying to hide from a highly organized group of criminals during a bank heist. They decide to hide in full knight armor suits, which becomes a plot point and a way to make multiple jokes:
- They make an attempt at being stealthy.
- They use their disguises to hide in plain sight, but one of them gets beaten-up by the leader of the bad guys who is taking out his frustration on what he thinks is an empty armor.
- In The Pirate Movie, Kristy McNichol's character (Mabel — it's an updated version of Gilbert and Sullivan's The Pirates of Penzance) hides in a suit of armor during the Pirates' final attack on the mansion. (It's also a bit of commentary on how difficult it is for Frederick to get to her.)
- In Wizards of the Lost Kingdom 2, when Tyor's chased by Donar's guards, he hides inside a suit of armor on display. Then, in the suit of armor, he points down the hall and tells the guards that the kid they're chasing went that-a-way, and the guards fall for it.
- In Ivan Vasilievich Changes Profession, Miloslavsky gets into a suit of armor to hide. He then takes out the unwitting guards one by one with his armored fist.
- In Paddington 2, Phoenix hides in a suit of armour to sneak by a night guard.
- In Beau Geste, hiding in a suit of armor is how Michael "Beau" Geste knows that the Blue Water has been replaced with a fake — he sees his aunt selling the real Blue Water while she is unaware that he can see her from his hiding place in the armor.
- In Harry Potter and the Goblet of Fire this trope is Played With. Peeves the poltergeist enters suits of armor not to hide, but to replace the carols they had been bewitched to sing with rude versions.
- In the Enid Blyton book The Castle Of Adventure, one of the children, Phillip, ends up hiding all day inside a suit of armour from the criminal gang. He is rather blasé about it, and reckons the worst part was having to stifle a sneeze.
- One of the Nancy Drew and Hardy Boys crossover stories featured an attempt to steal a famous suit of armor custom made for a woman to follow her lover into battle. The sleuths get a tip a second attempt will be made, so they have time to set a trap in advance, deciding that Nancy will wear the targeted armor and the boys will wear two other sets from the collection. They need help to get the armor on from the professionals charged with its care, and remark about how cumbersome and hard to see in it is.
- In Blade of the Guillotine, a book in the Time Machine series, this happens unwillingly to the protagonist at one point—his time machine somehow deposits him exactly inside a knight armor, which allows him to eavesdrop on some people nearby.
- Catherine Aird's The Complete Steel shows that a suit of armour is also a handy place to stash a dead body.
- From Dragon: "The Wizards Three", a series of humorous short stories by Ed Greenwood in which Mordenkainen of Greyhawk, Elminster of the Forgotten Realms, and Dalamar of Dragonlance met for friendly dinner parties in Ed's dining room while Ed hides in a suit of armor.
- One puzzle in Broken Sword: The Shadow of the Templars involves hiding behind a suit of armour after drawing the attention of an NPC you have to sneak past. Looking at it has George contemplate actually putting it on, but admitting that it would be impractical.
- Various levels of Hitman: Absolution allow the player to hide in a stationary position if they are wearing the correct disguise. On one level, this takes the form of Samurai armor, which the player can put on and then use to hide in plain sight by standing on the armor's display pedestal.
- In 101 Dalmatians: Escape from DeVil Manor, the dalmatian puppies Patches and Whizzer can weaponize this with a suit of armor that's holding a mace. If Horace and Jasper are alerted, Patches can whack them with the mace and send them tumbling back down the stairs.
- A horrible subversion of this is in Clock Tower (1995). One of the jump scares you can find is if you investigate a suit of armor. It falls over and the body of Laura, your friend, is in there. Either she was shoved in there by Scissorsman or she tried to hide in it. It was most likely a decorative suit of armor and not fitted for a human being. She dies as her chest is compressed and she couldn't breathe. It most likely wasn't quick either.
- Used to happen every other week in Scooby-Doo. Sometimes This Week's Villain would hide inside the armor while the Mystery Gang charged past; sometimes Scooby and Shaggy would fit into the Hammerspace inside a suit of armor so as to evade detection; on one occasion they try to hide in the armor only to find the villain is already in there...
- Looney Tunes:
- In "From hare to Heir", Yosemite Sam hides in a tiny suit of armor to attack Bugs with an axe. However, he misses and proceeds to take a tumble down a long flight of stairs, cussing all the while.
- Gossamer tries this once with a suit of armor, but his hair leak out of the edges of the parts of the suit.


In the following, you can import CEQ data from external sources like XML files. Specify the directory which contains your CEQ data base dump (in xml format).
Note : Manual import must be done only once.


Two Questions
-
shrimpcreole
First off, awesome software! MacWorld did you right in their review.
Questions:
1. I purchased Synergy Advance for $13, but my classic still shows unregistered. Will the software expire? Do I have to purchase it also?
2. When clicking on the note button and going to artist then to album, why does it not go then to song for me to play? Am I missing something that I should enable in options???
Thank you!
-
Greg Hurrell
Quote: 1. I purchased Synergy Advance for $13, but my classic still shows unregistered. Will the software expire? Do I have to purchase it also?
Synergy and Synergy Advance are two separate products with separate licensing systems so one does not check the license of the other. If you'd like a complimentary Synergy license let me know the email address you supplied when registering Synergy Advance; after a few more features have been added to Synergy Advance you probably won't want to run Synergy at all, but until then I'm happy to supply you with a temporary license. You can contact me directly using this page:
https://wincent.com/a/contact/mail/
Quote: 2. When clicking on the note button and going to artist then to album, why does it not go then to song for me to play? Am I missing something that I should enable in options???
This is a bug that was introduced in version 0.4b and which I have already fixed for version 0.5. To be notified when 0.5 comes out you can add yourself to the announcements list:
Reply
This topic is now closed.


This chapter explains how to use the Java Persistence API. The material here focuses on the source code and settings of three examples. The first example, order
, is an application that uses a stateful session bean to manage entities related to an ordering system. The second example, roster
, is an application that manages a community sports system. The third example, address-book
, is a web application that stores contact data. This chapter assumes that you are familiar with the concepts detailed in Chapter 37, "Introduction to the Java Persistence API".
The following topics are addressed here:
The order
application is a simple inventory and ordering application for maintaining a catalog of parts and placing an itemized order of those parts. The application has entities that represent parts, vendors, orders, and line items. These entities are accessed using a stateful session bean that holds the business logic of the application. A simple singleton session bean creates the initial entities on application deployment. A Facelets web application manipulates the data and displays data from the catalog.
The information contained in an order can be divided into elements. What is the order number? What parts are included in the order? What parts make up that part? Who makes the part? What are the specifications for the part? Are there any schematics for the part? The order
application is a simplified version of an ordering system that has all these elements.
The order
application consists of a single WAR module that includes the enterprise bean classes, the entities, the support classes, and the Facelets XHTML and class files.
The database schema in the Java DB database for order
is shown in Figure 38-1.
Figure 38-1 Database Schema for the order Application
|
Note: In this diagram, for simplicity, the |
The order
application demonstrates several types of entity relationships: self-referential, one-to-one, one-to-many, many-to-one, and unidirectional relationships.
A self-referential relationship occurs between relationship fields in the same entity. Part
has a field, bomPart
, which has a one-to-many relationship with the field parts
, which is also in Part
. That is, a part can be made up of many parts, and each of those parts has exactly one bill-of-material part.
The primary key for Part
is a compound primary key, a combination of the partNumber
and revision
fields. This key is mapped to the PARTNUMBER
and REVISION
columns in the PERSISTENCE_ORDER_PART
table:
... @ManyToOne @JoinColumns({ @JoinColumn(name="BOMPARTNUMBER", referencedColumnName="PARTNUMBER"), @JoinColumn(name="BOMREVISION", referencedColumnName="REVISION") }) public Part getBomPart() { return bomPart; } ... @OneToMany(mappedBy="bomPart") public Collection<Part> getParts() { return parts; } ...
Part
has a field, vendorPart
, that has a one-to-one relationship with VendorPart
's part
field. That is, each part has exactly one vendor part, and vice versa.
Here is the relationship mapping in Part
:
@OneToOne(mappedBy="part") public VendorPart getVendorPart() { return vendorPart; }
Here is the relationship mapping in VendorPart
:
@OneToOne @JoinColumns({ @JoinColumn(name="PARTNUMBER", referencedColumnName="PARTNUMBER"), @JoinColumn(name="PARTREVISION", referencedColumnName="REVISION") }) public Part getPart() { return part; }
Note that, because Part
uses a compound primary key, the @JoinColumns
annotation is used to map the columns in the PERSISTENCE_ORDER_VENDOR_PART
table to the columns in PERSISTENCE_ORDER_PART
. The PERSISTENCE_ORDER_VENDOR_PART
table's PARTREVISION
column refers to PERSISTENCE_ORDER_PART
's REVISION
column.
CustomerOrder
has a field, lineItems
, that has a one-to-many relationship with LineItem
's field customerOrder
. That is, each order has one or more line item.
LineItem
uses a compound primary key that is made up of the orderId
and itemId
fields. This compound primary key maps to the ORDERID
and ITEMID
columns in the PERSISTENCE_ORDER_LINEITEM
table. ORDERID
is a foreign key to the ORDERID
column in the PERSISTENCE_ORDER_CUSTOMERORDER
table. This means that the ORDERID
column is mapped twice: once as a primary key field, orderId
; and again as a relationship field, order
.
Here is the relationship mapping in CustomerOrder
:
@OneToMany(cascade=ALL, mappedBy="customerOrder") public Collection<LineItem> getLineItems() { return lineItems; }
Here is the relationship mapping in LineItem
:
@Id @ManyToOne @JoinColumn(name="ORDERID") public CustomerOrder getCustomerOrder() { return customerOrder; }
LineItem
has a field, vendorPart
, that has a unidirectional many-to-one relationship with VendorPart
. That is, there is no field in the target entity in this relationship:
@JoinColumn(name="VENDORPARTNUMBER") @ManyToOne public VendorPart getVendorPart() { return vendorPart; }
The order
application uses several types of primary keys: single-valued primary keys, generated primary keys, and compound primary keys.
VendorPart
uses a generated primary key value. That is, the application does not assign primary key values for the entities but instead relies on the persistence provider to generate the primary key values. The @GeneratedValue
annotation is used to specify that an entity will use a generated primary key.
In VendorPart
, the following code specifies the settings for generating primary key values:
@TableGenerator( name="vendorPartGen", table="PERSISTENCE_ORDER_SEQUENCE_GENERATOR", pkColumnName="GEN_KEY", valueColumnName="GEN_VALUE", pkColumnValue="VENDOR_PART_ID", allocationSize=10) @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="vendorPartGen") public Long getVendorPartNumber() { return vendorPartNumber; }
The @TableGenerator
annotation is used in conjunction with @GeneratedValue
's strategy=TABLE
element. That is, the strategy used to generate the primary keys is to use a table in the database. The @TableGenerator
annotation is used to configure the settings for the generator table. The name element sets the name of the generator, which is vendorPartGen
in VendorPart
.
The PERSISTENCE_ORDER_SEQUENCE_GENERATOR
table, whose two columns are GEN_KEY
and GEN_VALUE
, will store the generated primary key values. This table could be used to generate other entities' primary keys, so the pkColumnValue
element is set to VENDOR_PART_ID
to distinguish this entity's generated primary keys from other entities' generated primary keys. The allocationSize
element specifies the amount to increment when allocating primary key values. In this case, each VendorPart
's primary key will increment by 10.
The primary key field vendorPartNumber
is of type Long
, as the generated primary key's field must be an integral type.
A compound primary key is made up of multiple fields and follows the requirements described in Primary Keys in Entities. To use a compound primary key, you must create a wrapper class.
In order
, two entities use compound primary keys: Part
and LineItem
.
Part
uses the PartKey
wrapper class. Part
's primary key is a combination of the part number and the revision number. PartKey
encapsulates this primary key.
LineItem
uses the LineItemKey
class. LineItem
's primary key is a combination of the order number and the item number. LineItemKey
encapsulates this primary key.
This is the LineItemKey
compound primary key wrapper class:
package javaeetutorial.order.entity; import java.io.Serializable; public final class LineItemKey implements Serializable { private Integer customerOrder; private int itemId; public LineItemKey() {} public LineItemKey(Integer order, int itemId) { this.setCustomerOrder(order); this.setItemId(itemId); } @Override public int hashCode() { return ((this.getCustomerOrder() == null ? 0 : this.getCustomerOrder().hashCode()) ^ ((int) this.getItemId())); } @Override public boolean equals(Object otherOb) { if (this == otherOb) { return true; } if (!(otherOb instanceof LineItemKey)) { return false; } LineItemKey other = (LineItemKey) otherOb; return ((this.getCustomerOrder() == null ? other.getCustomerOrder == null : this.getOrderId() .equals(other.getCustomerOrder())) && (this.getItemId == oother.getItemId())); } @Override public String toString() { return "" + getCustomerOrder() + "-" + getItemId(); } public Integer getCustomerOrder() { return customerOrder; } public void setCustomerOrder(Integer order) { this.customerOrder = order; } public int getItemId() { return itemId; } public void setItemId(int itemId) { this.itemId = itemId; } }
The @IdClass
annotation is used to specify the primary key class in the entity class. In LineItem
, @IdClass
is used as follows:
@IdClass(LineItemKey.class) @Entity ... public class LineItem implements Serializable { ... }
The two fields in LineItem
are tagged with the @Id
annotation to mark those fields as part of the compound primary key:
@Id public int getItemId() { return itemId; } ... @Id @ManyToOne @JoinColumn(name="ORDERID") public CustomerOrder getCustomerOrder() { return customerOrder; }
For customerOrder
, you also use the @JoinColumn
annotation to specify the column name in the table and that this column is an overlapping foreign key pointing at the PERSISTENCE_ORDER_CUSTOMERORDER
table's ORDERID
column (see One-to-Many Relationship Mapped to Overlapping Primary and Foreign Keys). That is, customerOrder
will be set by the CustomerOrder
entity.
In LineItem
's constructor, the line item number (LineItem.itemId
) is set using the CustomerOrder.getNextId
method:
public LineItem(CustomerOrder order, int quantity, VendorPart vendorPart) { this.customerOrder = order; this.itemId = order.getNextId(); this.quantity = quantity; this.vendorPart = vendorPart; }
CustomerOrder.getNextId
counts the number of current line items, adds 1, and returns that number:
@Transient public int getNextId() { return this.lineItems.size() + 1; }
Part
requires the @Column
annotation on the two fields that comprise Part
's compound primary key, because Part
's compound primary key is an overlapping primary key/foreign key:
@IdClass(PartKey.class) @Entity ... public class Part implements Serializable { ... @Id @Column(nullable=false) public String getPartNumber() { return partNumber; } ... @Id @Column(nullable=false) public int getRevision() { return revision; } ... }
Part
's fields map to more than one database table: PERSISTENCE_ORDER_PART
and PERSISTENCE_ORDER_PART_DETAIL
. The PERSISTENCE_ORDER_PART_DETAIL
table holds the specification and schematics for the part. The @SecondaryTable
annotation is used to specify the secondary table:
... @Entity @Table(name="PERSISTENCE_ORDER_PART") @SecondaryTable(name="PERSISTENCE_ORDER_PART_DETAIL", pkJoinColumns={ @PrimaryKeyJoinColumn(name="PARTNUMBER", referencedColumnName="PARTNUMBER"), @PrimaryKeyJoinColumn(name="REVISION", referencedColumnName="REVISION") }) public class Part implements Serializable { ... }
PERSISTENCE_ORDER_PART_DETAIL
and PERSISTENCE_ORDER_PART
share the same primary key values. The pkJoinColumns
element of @SecondaryTable
is used to specify that PERSISTENCE_ORDER_PART_DETAIL
's primary key columns are foreign keys to PERSISTENCE_ORDER_PART
. The @PrimaryKeyJoinColumn
annotation sets the primary key column names and specifies which column in the primary table the column refers to. In this case, the primary key column names for both PERSISTENCE_ORDER_PART_DETAIL
and PERSISTENCE_ORDER_PART
are the same: PARTNUMBER
and REVISION
, respectively.
Entities that have relationships to other entities often have dependencies on the existence of the other entity in the relationship. For example, a line item is part of an order; if the order is deleted, then the line item also should be deleted. This is called a cascade delete relationship.
In order
, there are two cascade delete dependencies in the entity relationships. If the CustomerOrder
to which a LineItem
is related is deleted, the LineItem
also should be deleted. If the Vendor
to which a VendorPart
is related is deleted, the VendorPart
also should be deleted.
You specify the cascade operations for entity relationships by setting the cascade
element in the inverse (nonowning) side of the relationship. The cascade element is set to ALL
in the case of CustomerOrder.lineItems
. This means that all persistence operations (deletes, updates, and so on) are cascaded from orders to line items.
Here is the relationship mapping in CustomerOrder
:
@OneToMany(cascade=ALL, mappedBy="customerOrder") public Collection<LineItem> getLineItems() { return lineItems; }
Here is the relationship mapping in LineItem
:
@Id @ManyToOne @JoinColumn(name="ORDERID") public CustomerOrder getCustomerOrder() { return customerOrder; }
The PARTDETAIL
table in the database has a column, DRAWING
, of type BLOB
. BLOB
stands for binary large objects, which are used for storing binary data, such as an image. The DRAWING
column is mapped to the field Part.drawing
of type java.io.Serializable
. The @Lob
annotation is used to denote that the field is a large object:
@Column(table="PERSISTENCE_ORDER_PART_DETAIL") @Lob public Serializable getDrawing() { return drawing; }
PERSISTENCE_ORDER_PART_DETAIL
also has a column, SPECIFICATION
, of type CLOB
. CLOB
stands for character large objects, which are used to store string data too large to be stored in a VARCHAR
column. SPECIFICATION
is mapped to the field Part.specification
of type java.lang.String
. The @Lob
annotation is also used here to denote that the field is a large object:
@Column(table="PERSISTENCE_ORDER_PART_DETAIL") @Lob public String getSpecification() { return specification; }
Both of these fields use the @Column
annotation and set the table
element to the secondary table.
The CustomerOrder.lastUpdate
persistent property, which is of type java.util.Date
, is mapped to the PERSISTENCE_ORDER_CUSTOMERORDER.LASTUPDATE
database field, which is of the SQL type TIMESTAMP
. To ensure the proper mapping between these types, you must use the @Temporal
annotation with the proper temporal type specified in @Temporal
's element. @Temporal
's elements are of type javax.persistence.TemporalType
. The possible values are
DATE
, which maps to java.sql.Date
TIME
, which maps to java.sql.Time
TIMESTAMP
, which maps to java.sql.Timestamp
Here is the relevant section of CustomerOrder
:
@Temporal(TIMESTAMP) public Date getLastUpdate() { return lastUpdate; }
The RequestBean
stateful session bean contains the business logic and manages the entities of order
. RequestBean
uses the @PersistenceContext
annotation to retrieve an entity manager instance, which is used to manage order
's entities in RequestBean
's business methods:
@PersistenceContext private EntityManager em;
This EntityManager
instance is a container-managed entity manager, so the container takes care of all the transactions involved in managing order
's entities.
The RequestBean.createPart
business method creates a new Part
entity. The EntityManager.persist
method is used to persist the newly created entity to the database:
Part part = new Part(partNumber, revision, description, revisionDate, specification, drawing); em.persist(part);
The ConfigBean
singleton session bean is used to initialize the data in order
. ConfigBean
is annotated with @Startup
, which indicates that the EJB container should create ConfigBean
when order
is deployed. The createData
method is annotated with @PostConstruct
and creates the initial entities used by order
by calling RequestBean
's business methods.
The RequestBean.getOrderPrice
business method returns the price of a given order based on the orderId
. The EntityManager.find
method is used to retrieve the entity from the database:
CustomerOrder order = em.find(CustomerOrder.class, orderId);
The first argument of EntityManager.find
is the entity class, and the second is the primary key.
The RequestBean.createVendorPart
business method creates a VendorPart
associated with a particular Vendor
. The EntityManager.persist
method is used to persist the newly created VendorPart
entity to the database, and the VendorPart.setVendor
and Vendor.setVendorPart
methods are used to associate the VendorPart
with the Vendor
:
PartKey pkey = new PartKey(); pkey.setPartNumber(partNumber); pkey.setRevision(revision); Part part = em.find(Part.class, pkey); VendorPart vendorPart = new VendorPart(description, price, part); em.persist(vendorPart); Vendor vendor = em.find(Vendor.class, vendorId); vendor.addVendorPart(vendorPart); vendorPart.setVendor(vendor);
The RequestBean.adjustOrderDiscount
business method updates the discount applied to all orders. This method uses the findAllOrders
named query, defined in CustomerOrder
:
@NamedQuery( name="findAllOrders", query="SELECT co FROM CustomerOrder co " + "ORDER BY co.orderId" )
The EntityManager.createNamedQuery
method is used to run the query. Because the query returns a List
of all the orders, the Query.getResultList
method is used:
List orders = em.createNamedQuery( "findAllOrders") .getResultList();
The RequestBean.getTotalPricePerVendor
business method returns the total price of all the parts for a particular vendor. This method uses a named parameter, id
, defined in the named query findTotalVendorPartPricePerVendor
defined in VendorPart
:
@NamedQuery( name="findTotalVendorPartPricePerVendor", query="SELECT SUM(vp.price) " + "FROM VendorPart vp " + "WHERE vp.vendor.vendorId = :id" )
When running the query, the Query.setParameter
method is used to set the named parameter id
to the value of vendorId
, the parameter to RequestBean.getTotalPricePerVendor
:
return (Double) em.createNamedQuery( "findTotalVendorPartPricePerVendor") .setParameter("id", vendorId) .getSingleResult();
The Query.getSingleResult
method is used for this query because the query returns a single value.
You can use either NetBeans IDE or Maven to build, package, deploy, and run the order
application. First, you will create the database tables in the Java DB server.
Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).
If the database server is not already running, start it by following the instructions in Starting and Stopping the Java DB Server.
From the File menu, choose Open Project.
In the Open Project dialog box, navigate to:
tut-install/examples/persistence
Select the order
folder.
Click Open Project.
In the Projects tab, right-click the order
project and select Run.
NetBeans IDE opens a web browser to the following URL:
http://localhost:8080/order/
Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).
If the database server is not already running, start it by following the instructions in Starting and Stopping the Java DB Server.
In a terminal window, go to:
tut-install/examples/persistence/order/
Enter the following command:
mvn install
This compiles the source files and packages the application into a WAR file located at tut-install/examples/persistence/order/target/order.war
. Then the WAR file is deployed to your GlassFish Server instance.
To create and update the order data, open a web browser to the following URL:
http://localhost:8080/order/
The roster
application maintains the team rosters for players in recreational sports leagues. The application has four components: Java Persistence API entities (Player
, Team
, and League
), a stateful session bean (RequestBean
), an application client (RosterClient
), and three helper classes (PlayerDetails
, TeamDetails
, and LeagueDetails
).
Functionally, roster
is similar to the order
application, with three new features that order
does not have: many-to-many relationships, entity inheritance, and automatic table creation at deployment time.
The database schema in the Java DB database for the roster
application is shown in Figure 38-2.
Figure 38-2 Database Schema for the roster Application
|
Note: In this diagram, for simplicity, the |
A recreational sports system has the following relationships.
A player can be on many teams.
A team can have many players.
A team is in exactly one league.
A league has many teams.
In roster
this system is reflected by the following relationships between the Player
, Team
, and League
entities.
There is a many-to-many relationship between Player
and Team
.
There is a many-to-one relationship between Team
and League
.
The many-to-many relationship between Player
and Team
is specified by using the @ManyToMany
annotation. In Team.java
, the @ManyToMany
annotation decorates the getPlayers
method:
@ManyToMany @JoinTable( name="PERSISTENCE_ROSTER_TEAM_PLAYER", joinColumns= @JoinColumn(name="TEAM_ID", referencedColumnName="ID"), inverseJoinColumns= @JoinColumn(name="PLAYER_ID", referencedColumnName="ID") ) public Collection<Player> getPlayers() { return players; }
The @JoinTable
annotation is used to specify a database table that will associate player IDs with team IDs. The entity that specifies the @JoinTable
is the owner of the relationship, so the Team
entity is the owner of the relationship with the Player
entity. Because roster
uses automatic table creation at deployment time, the container will create a join table named PERSISTENCE_ROSTER_TEAM_PLAYER
.
Player
is the inverse, or nonowning, side of the relationship with Team
. As one-to-one and many-to-one relationships, the nonowning side is marked by the mappedBy
element in the relationship annotation. Because the relationship between Player
and Team
is bidirectional, the choice of which entity is the owner of the relationship is arbitrary.
In Player.java
, the @ManyToMany
annotation decorates the getTeams
method:
@ManyToMany(mappedBy="players") public Collection<Team> getTeams() { return teams; }
The roster
application shows how to use entity inheritance, as described in Entity Inheritance.
The League
entity in roster
is an abstract entity with two concrete subclasses: SummerLeague
and WinterLeague
. Because League
is an abstract class, it cannot be instantiated:
@Entity @Table(name = "PERSISTENCE_ROSTER_LEAGUE") public abstract class League implements Serializable { ... }
Instead, when creating a league, clients use SummerLeague
or WinterLeague
. SummerLeague
and WinterLeague
inherit the persistent properties defined in League
and add only a constructor that verifies that the sport parameter matches the type of sport allowed in that seasonal league. For example, here is the SummerLeague
entity:
... @Entity public class SummerLeague extends League implements Serializable { /** Creates a new instance of SummerLeague */ public SummerLeague() { } public SummerLeague(String id, String name, String sport) throws IncorrectSportException { this.id = id; this.name = name; if (sport.equalsIgnoreCase("swimming") || sport.equalsIgnoreCase("soccer") || sport.equalsIgnoreCase("basketball") || sport.equalsIgnoreCase("baseball")) { this.sport = sport; } else { throw new IncorrectSportException("Sport is not a summer sport."); } } }
The roster
application uses the default mapping strategy of InheritanceType.SINGLE_TABLE
, so the @Inheritance
annotation is not required. If you want to use a different mapping strategy, decorate League
with @Inheritance
and specify the mapping strategy in the strategy
element:
@Entity @Inheritance(strategy=JOINED) @Table(name="PERSISTENCE_ROSTER_LEAGUE") public abstract class League implements Serializable { ... }
The roster
application uses the default discriminator column name, so the @DiscriminatorColumn
annotation is not required. Because you are using automatic table generation in roster
, the Persistence provider will create a discriminator column called DTYPE
in the PERSISTENCE_ROSTER_LEAGUE
table, which will store the name of the inherited entity used to create the league. If you want to use a different name for the discriminator column, decorate League
with @DiscriminatorColumn
and set the name
element:
@Entity @DiscriminatorColumn(name="DISCRIMINATOR") @Table(name="PERSISTENCE_ROSTER_LEAGUE") public abstract class League implements Serializable { ... }
The roster
application uses Criteria API queries, as opposed to the JPQL queries used in order
. Criteria queries are Java programming language, typesafe queries defined in the business tier of roster
, in the RequestBean
stateful session bean.
Metamodel classes model an entity's attributes and are used by Criteria queries to navigate to an entity's attributes. Each entity class in roster
has a corresponding metamodel class, generated at compile time, with the same package name as the entity and appended with an underscore character (_). For example, the roster.entity.Player
entity has a corresponding metamodel class, roster.entity.Player_
.
Each persistent field or property in the entity class has a corresponding attribute in the entity's metamodel class. For the Player
entity, the corresponding metamodel class is as follows:
@StaticMetamodel(Player.class) public class Player_ { public static volatile SingularAttribute<Player, String> id; public static volatile SingularAttribute<Player, String> name; public static volatile SingularAttribute<Player, String> position; public static volatile SingularAttribute<Player, Double> salary; public static volatile CollectionAttribute<Player, Team> teams; }
The CriteriaBuilder
interface defines methods to create criteria query objects and create expressions for modifying those query objects. RequestBean
creates an instance of CriteriaBuilder
by using a @PostConstruct
method, init
:
@PersistenceContext private EntityManager em; private CriteriaBuilder cb; @PostConstruct private void init() { cb = em.getCriteriaBuilder(); }
The EntityManager
instance is injected at runtime, and then that EntityManager
object is used to create the CriteriaBuilder
instance by calling getCriteriaBuilder
. The CriteriaBuilder
instance is created in a @PostConstruct
method to ensure that the EntityManager
instance has been injected by the enterprise bean container.
Many of the business methods in RequestBean
define Criteria queries. One business method, getPlayersByPosition
, returns a list of players who play a particular position on a team:
public List<PlayerDetails> getPlayersByPosition(String position) { logger.info("getPlayersByPosition"); List<Player> players = null; try { CriteriaQuery<Player> cq = cb.createQuery(Player.class); if (cq != null) { Root<Player> player = cq.from(Player.class); // set the where clause cq.where(cb.equal(player.get(Player_.position), position)); cq.select(player); TypedQuery<Player> q = em.createQuery(cq); players = q.getResultList(); } return copyPlayersToDetails(players); } catch (Exception ex) { throw new EJBException(ex); } }
A query object is created by calling the CriteriaBuilder
object's createQuery
method, with the type set to Player
because the query will return a list of players.
The query root, the base entity from which the query will navigate to find the entity's attributes and related entities, is created by calling the from
method of the query object. This sets the FROM
clause of the query.
The WHERE
clause, set by calling the where
method on the query object, restricts the results of the query according to the conditions of an expression. The CriteriaBuilder.equal
method compares the two expressions. In getPlayersByPosition
, the position
attribute of the Player_
metamodel class, accessed by calling the get
method of the query root, is compared to the position
parameter passed to getPlayersByPosition
.
The SELECT
clause of the query is set by calling the select
method of the query object. The query will return Player
entities, so the query root object is passed as a parameter to select
.
The query object is prepared for execution by calling EntityManager.createQuery
, which returns a TypedQuery<T>
object with the type of the query, in this case Player
. This typed query object is used to execute the query, which occurs when the getResultList
method is called, and a List<Player>
collection is returned.
At deployment time, GlassFish Server will automatically drop and create the database tables used by roster
. This is done by setting the javax.persistence.schema-generation.database.action
property to drop-and-create
in persistence.xml
:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="em" transaction-type="JTA"> <jta-data-source>java:comp/DefaultDataSource</jta-data-source> <properties> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> </properties> </persistence-unit> </persistence>
You can use either NetBeans IDE or Maven to build, package, deploy, and run the roster
application.
Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).
If the database server is not already running, start it by following the instructions in Starting and Stopping the Java DB Server.
From the File menu, choose Open Project.
In the Open Project dialog box, navigate to:
tut-install/examples/persistence
Select the roster
folder.
Select the Open Required Projects check box.
Click Open Project.
In the Projects tab, right-click the roster
project and select Build.
This will compile, package, and deploy the EAR to GlassFish Server.
You will see the following partial output from the application client in the Output tab:
List all players in team T2: P6 Ian Carlyle goalkeeper 555.0 P7 Rebecca Struthers midfielder 777.0 P8 Anne Anderson forward 65.0 P9 Jan Wesley defender 100.0 P10 Terry Smithson midfielder 100.0 List all teams in league L1: T1 Honey Bees Visalia T2 Gophers Manteca T5 Crows Orland List all defenders: P2 Alice Smith defender 505.0 P5 Barney Bold defender 100.0 P9 Jan Wesley defender 100.0 P22 Janice Walker defender 857.0 P25 Frank Fletcher defender 399.0
Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).
If the database server is not already running, start it by following the instructions in Starting and Stopping the Java DB Server.
In a terminal window, go to:
tut-install/examples/persistence/roster/roster-ear/
Enter the following command:
mvn install
This compiles the source files and packages the application into an EAR file located at tut-install/examples/persistence/roster/target/roster.ear
. The EAR file is then deployed to GlassFish Server. GlassFish Server will then drop and create the database tables during deployment, as specified in persistence.xml
.
After successfully deploying the EAR, the client stubs are retrieved and the application client is run using the appclient application included with GlassFish Server.
You will see the output, which begins as follows:
[echo] running application client container. [exec] List all players in team T2: [exec] P6 Ian Carlyle goalkeeper 555.0 [exec] P7 Rebecca Struthers midfielder 777.0 [exec] P8 Anne Anderson forward 65.0 [exec] P9 Jan Wesley defender 100.0 [exec] P10 Terry Smithson midfielder 100.0 [exec] List all teams in league L1: [exec] T1 Honey Bees Visalia [exec] T2 Gophers Manteca [exec] T5 Crows Orland [exec] List all defenders: [exec] P2 Alice Smith defender 505.0 [exec] P5 Barney Bold defender 100.0 [exec] P9 Jan Wesley defender 100.0 [exec] P22 Janice Walker defender 857.0 [exec] P25 Frank Fletcher defender 399.0
The address-book
example application is a simple web application that stores contact data. It uses a single entity class, Contact
, that uses the Java API for JavaBeans Validation (Bean Validation) to validate the data stored in the persistent attributes of the entity, as described in Validating Persistent Fields and Properties.
The Contact
entity uses the @NotNull
, @Pattern
, and @Past
constraints on the persistent attributes.
The @NotNull
constraint marks the attribute as a required field. The attribute must be set to a non-null value before the entity can be persisted or modified. Bean Validation will throw a validation error if the attribute is null when the entity is persisted or modified.
The @Pattern
constraint defines a regular expression that the value of the attribute must match before the entity can be persisted or modified. This constraint has two different uses in address-book
.
The regular expression declared in the @Pattern
annotation on the email
field matches email addresses of the form name@
domain name.
top level domain, allowing only valid characters for email addresses. For example<EMAIL_ADDRESS>will pass validation, as will<EMAIL_ADDRESS>. However<EMAIL_ADDRESS>, which contains an illegal comma character in the local name, will fail validation.
The mobilePhone
and homePhone
fields are annotated with a @Pattern
constraint that defines a regular expression to match phone numbers of the form (
xxx)
xxx-
xxxx.
The @Past
constraint is applied to the birthday field, which must be a java.util.Date
in the past.
Here are the relevant parts of the Contact
entity class:
@Entity public class Contact implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @NotNull protected String firstName; @NotNull protected String lastName; @Pattern(regexp = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\." + "[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9]" + "(?:[a-z0-9-]*[a-z0-9])?", message = "{invalid.email}") protected String email; @Pattern(regexp = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message = "{invalid.phonenumber}") protected String mobilePhone; @Pattern(regexp = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message = "{invalid.phonenumber}") protected String homePhone; @Temporal(javax.persistence.TemporalType.DATE) @Past protected Date birthday; ... }
Some of the constraints in the Contact
entity specify an optional message:
@Pattern(regexp = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message = "{invalid.phonenumber}") protected String homePhone;
The optional message element in the @Pattern
constraint overrides the default validation message. The message can be specified directly:
@Pattern(regexp = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message = "Invalid phone number!") protected String homePhone;
The constraints in Contact
, however, are strings in the resource bundle ValidationMessages.properties
, under tut-install/examples/persistence/address-book/src/java/
. This allows the validation messages to be located in one single properties file and the messages to be easily localized. Overridden Bean Validation messages must be placed in a resource bundle properties file named ValidationMessages.properties
in the default package, with localized resource bundles taking the form ValidationMessages_
locale-prefix.properties
. For example, ValidationMessages_es.properties
is the resource bundle used in Spanish-speaking locales.
The address-book
application uses a JavaServer Faces web front end to allow users to enter contacts. While JavaServer Faces has a form input validation mechanism using tags in Facelets XHTML files, address-book
doesn't use these validation tags. Bean Validation constraints in JavaServer Faces managed beans, in this case in the Contact
entity, automatically trigger validation when the forms are submitted.
The following code snippet from the Create.xhtml
Facelets file shows some of the input form for creating new Contact
instances:
<h:form> <table columns="3" role="presentation"> <tr> <td><h:outputLabel value="#{bundle.CreateContactLabel_firstName}" for="firstName" /></td> <td><h:inputText id="firstName" value="#{contactController.selected.firstName}" title="#{bundle.CreateContactTitle_firstName}"/> </td> <td><h:message for="firstName" /></td> </tr> <tr> <td><h:outputLabel value="#{bundle.CreateContactLabel_lastName}" for="lastName" /></td> <td><h:inputText id="lastName" value="#{contactController.selected.lastName}" title="#{bundle.CreateContactTitle_lastName}" /> </td> <td><h:message for="lastName" /></td> </tr> ... </table> </h:form>
The <h:inputText>
tags firstName
and lastName
are bound to the attributes in the Contact
entity instance selected
in the ContactController
stateless session bean. Each <h:inputText>
tag has an associated <h:message>
tag that will display validation error messages. The form doesn't require any JavaServer Faces validation tags, however.
You can use either NetBeans IDE or Maven to build, package, deploy, and run the address-book
application.
Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).
If the database server is not already running, start it by following the instructions in Starting and Stopping the Java DB Server.
From the File menu, choose Open Project.
In the Open Project dialog box, navigate to:
tut-install/examples/persistence
Select the address-book
folder.
Click Open Project.
In the Projects tab, right-click the address-book
project and select Run.
After the application has been deployed, a web browser window appears at the following URL:
http://localhost:8080/address-book/
Click Show All Contact Items, then Create New Contact. Enter values in the fields; then click Save.
If any of the values entered violate the constraints in Contact
, an error message will appear in red beside the field with the incorrect values.
Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).
If the database server is not already running, start it by following the instructions in Starting and Stopping the Java DB Server.
In a terminal window, go to:
tut-install/examples/persistence/address-book/
Enter the following command:
mvn install
This will compile and assemble the address-book
application into a WAR. The WAR file is then deployed to GlassFish Server.
Open a web browser window and enter the following URL:
http://localhost:8080/address-book/
Click Show All Contact Items, then Create New Contact. Enter values in the fields; then click Save.
If any of the values entered violate the constraints in Contact
, an error message will appear in red beside the field with the incorrect values.


What's new in DocuTube?
- Search! Stop leaving your doc to find the video you want.
- Embed! You can now embed the video thumbnail or title right into your document (at the cursor location).
- Copy! If you don't want to embed, you can copy the link right to your clipboard.
- Watch! All videos are now loaded at the same time - no more choosing between the doc or comments.
See more on the DocuTube home page.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.expr.XPathContext
This class represents a context in which an XPath expression is evaluated.
| Constructor Summary | |
XPathContext(Controller c)
Constructor should only be called by the Controller, which acts as a XPathContext factory. |
|
XPathContext(Item item,
Configuration config)
Constructor for use in free-standing Java applications. |
|
XPathContext(XPathContext c)
Constructor to create one XPathContext as a copy of another |
| Method Summary | |
Value |
evaluateLocalVariable(int slotnumber)
Get the value of a local variable, identified by its slot number |
java.util.Comparator |
getCollation(java.lang.String name)
Get a named collation |
Item |
getContextItem()
Get the context item (XPath 2.0) |
int |
getContextPosition()
Get the context position (the position of the context node in the context node list) |
Controller |
getController()
Get the Controller. |
SequenceIterator |
getCurrentIterator()
Get the current iterator |
Item |
getCurrentStylesheetItem()
Get the current stylesheet item: supports the XSLT current() function |
java.util.Comparator |
getDefaultCollation()
Get the default collation |
int |
getLast()
Get the context size (the position of the last item in the current node list) |
java.lang.Object[] |
getLocalVariableFrame()
Get a reference to the local stack frame for variables. |
boolean |
isAtLast()
Determine whether the context position is the same as the context size that is, whether position()=last() |
XPathContext |
newContext()
Construct a new context as a copy of another |
void |
setCurrentIterator(SequenceIterator iter)
Set a new sequence iterator. |
void |
setLocalVariable(int slotnumber,
Value value)
Set the value of a local variable, identified by its slot number |
void |
setLocalVariableFrame(java.lang.Object[] variables)
Set the local stack frame. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XPathContext(Controller c)
public XPathContext(XPathContext c)
public XPathContext(Item item, Configuration config)
| Method Detail |
public XPathContext newContext()
public Controller getController()
public void setCurrentIterator(SequenceIterator iter)
public SequenceIterator getCurrentIterator()
public int getContextPosition() throws XPathException
XPathException
public Item getContextItem()
public int getLast() throws XPathException
XPathException
public boolean isAtLast() throws XPathException
XPathException
public Item getCurrentStylesheetItem() throws XPathException
XPathException
public java.util.Comparator getCollation(java.lang.String name) throws XPathException
XPathException
public java.util.Comparator getDefaultCollation()
public java.lang.Object[] getLocalVariableFrame()
public void setLocalVariableFrame(java.lang.Object[] variables)
public Value evaluateLocalVariable(int slotnumber)
public void setLocalVariable(int slotnumber, Value value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


disipyl is an object-oriented wrapper around the DISLIN plotting library. disipyl provides a set of classes which represent various aspects of DISLIN plots, as well as providing some easy to use classes for creating commonly used plot formats (e.g. scatter plots, histograms, 3-D surface plots). A major goal in designing the library was to facilitate interactive data exploration and plot creation.
A longer list of the feature provided by disipyl can be found here.
DISLIN is a powerful and flexible multiplatform (Win32, Unix, Linux, etc.) programming library designed for displaying scientific data. DISLIN's author, Helmut Michels, has made available a free DISLIN plotting extension for the Python programming language (see the DISLIN homepage for more details).
The default Python interface provided with DISLIN is very terse, and essentially mirrors it's C and Fortran interfaces. To create a complex plot the user must make a series of function calls in just the right order. Despite it's terseness, when employed effectively, DISLIN can churn out detailed, publication quality plots. disipyl makes it easy to do so!
In addition to the wrapper classes and functions, disipyl includes a variety of "extensions":
disipyl descends from pxDislin, a previous wrapper-library I designed. disipyl shares much in common with pxDislin but represents a complete rewrite. disipyl presents a much cleaner interface, and is easier to maintain and extend. By starting "from scratch" I was able to keep the things I liked about pxDislin while ridding myself of the extra baggage that had accumulated around my earlier design.
The library has been tested on WinNT and FreeBSD, but I anticipate that it should work on any platform which can make use of Python, Numpy, and the DISLIN python extensions.
This is the first public release of disipyl, and as such it should be regarded as "beta" quality code. I've spent a lot of time using the library myself, and I've tried to create demos and test code which puts the library through its paces. Nevertheless, there are bound to be bugs. I'm interested in quickly squashing those bugs and moving rapidly towards a stable 1.0 release. In order to do this I will need lots of feedback from users. Please make sure to submit any and all bug reports. I am shooting for a turn around of less than 24 hours for fixes on bug reports submitted with example code.
I believe the interface is pretty much stable. There maybe a few tweaks and fiddlings here and there, but barring any major complaints from users, all the base classes should be pretty close to done.
A few classes could use some more attention (e.g. PieChart), and a small number of DISLIN features that I've never used (e.g., map plots) need to be wrapped. It would also be useful to improve the error checking.


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.simpleframework.util.parse.ParseBuffer
public class ParseBuffer
This is primarily used to replace the StringBuffer
class, as a way for the Parser
to store the char's
for a specific region within the parse data that constitutes a
desired value. The methods are not synchronized so it enables
the char
's to be taken quicker than the
StringBuffer
class.
| Field Summary | |
|---|---|
protected char[] |
buf
The char 's this buffer accumulated. |
protected java.lang.String |
cache
This is used to quicken toString . |
protected int |
count
This is the number of char 's stored. |
| Constructor Summary | |
|---|---|
ParseBuffer()
Constructor for ParseBuffer . |
|
ParseBuffer(int size)
This creates a ParseBuffer with a specific
default size. |
| Method Summary | |
|---|---|
void |
append(char c)
This will add a char to the end of the buffer. |
void |
append(char[] c,
int off,
int len)
This will add a char to the end of the buffer. |
void |
append(ParseBuffer text)
This will add a ParseBuffer to the end of this. |
void |
append(ParseBuffer text,
int off,
int len)
This will add a ParseBuffer to the end of this. |
void |
append(java.lang.String text)
This will add a String to the end of the buffer. |
void |
append(java.lang.String str,
int off,
int len)
This will add a String to the end of the buffer. |
void |
clear()
This will empty the ParseBuffer so that the
toString parameter will return null . |
protected void |
ensureCapacity(int min)
This ensure that there is enough space in the buffer to allow for more char 's to be added. |
int |
length()
This will return the number of bytes that have been appended to the ParseBuffer . |
void |
reset(ParseBuffer text)
This will reset the buffer in such a way that the buffer is cleared of all contents and then has the given string appended. |
void |
reset(java.lang.String text)
This will reset the buffer in such a way that the buffer is cleared of all contents and then has the given string appended. |
java.lang.String |
toString()
This will return the characters that have been appended to the ParseBuffer as a String object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String cache
toString
.
protected char[] buf
char
's this buffer accumulated.
protected int count
char
's stored.
| Constructor Detail |
|---|
public ParseBuffer()
ParseBuffer
. The default
ParseBuffer
stores 16 char
's
before a resize
is needed to accommodate
extra characters.
public ParseBuffer(int size)
ParseBuffer
with a specific
default size. The buffer will be created the with the
length specified. The ParseBuffer
can grow
to accommodate a collection of char
's larger
the the size specified.
size
- initial size of this ParseBuffer
| Method Detail |
|---|
public void append(char c)
char
to the end of the buffer.
The buffer will not overflow with repeated uses of the
append
, it uses an ensureCapacity
method which will allow the buffer to dynamically grow in
size to accommodate more char
's.
c
- the char
to be appendedpublic void append(java.lang.String text)
String
to the end of the buffer.
The buffer will not overflow with repeated uses of the
append
, it uses an ensureCapacity
method which will allow the buffer to dynamically grow in
size to accommodate large String
objects.
text
- the String
to be appended to thispublic void reset(java.lang.String text)
append(String)
method for reference.
text
- this is the text that is to be appended to thispublic void append(ParseBuffer text)
ParseBuffer
to the end of this.
The buffer will not overflow with repeated uses of the
append
, it uses an ensureCapacity
method which will allow the buffer to dynamically grow in
size to accommodate large ParseBuffer
objects.
text
- the ParseBuffer
to be appendedpublic void reset(ParseBuffer text)
append(ParseBuffer)
method for reference.
text
- this is the text that is to be appended to thispublic void append(char[] c, int off, int len)
char
to the end of the buffer.
The buffer will not overflow with repeated uses of the
append
, it uses an ensureCapacity
method which will allow the buffer to dynamically grow in
size to accommodate large char
arrays.
c
- the char
array to be appended to thisoff
- the read offset for the arraylen
- the number of char
's to addpublic void append(java.lang.String str, int off, int len)
String
to the end of the buffer.
The buffer will not overflow with repeated uses of the
append
, it uses an ensureCapacity
method which will allow the buffer to dynamically grow in
size to accommodate large String
objects.
str
- the String
to be appended to thisoff
- the read offset for the String
len
- the number of char
's to addpublic void append(ParseBuffer text, int off, int len)
ParseBuffer
to the end of this.
The buffer will not overflow with repeated uses of the
append
, it uses an ensureCapacity
method which will allow the buffer to dynamically grow in
size to accommodate large ParseBuffer
objects.
text
- the ParseBuffer
to be appendedoff
- the read offset for the ParseBuffer
len
- the number of char
's to addprotected void ensureCapacity(int min)
char
's to be added. If
the buffer is already larger than min then the buffer
will not be expanded at all.
min
- the minimum size neededpublic void clear()
ParseBuffer
so that the
toString
parameter will return null
.
This is used so that the same ParseBuffer
can be
recycled for different tokens.
public int length()
ParseBuffer
. This will return zero after
the clear method has been invoked.
char
's within the bufferpublic java.lang.String toString()
ParseBuffer
as a String
object.
If the String
object has been created before then
a cached String
object will be returned. This
method will return null
after clear is invoked.
toString
in class java.lang.Object
char
's appended as a String
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Beto O’Rourke Ends 2020 Presidential Campaign
by ERIK DE LA GARZA(CN) – Former Congressman Beto O’Rourke officially dropped out of the presidential race on Friday, ending a campaign that struggled for months to break through to voters on a national stage despite the Texas Democrat’s enthusiastic kickoff and early infusion of cash.
“Though it is difficult to accept, it is clear to me now that this campaign does not have the means to move forward successfully,” O’Rourke wrote in a Medium post published Friday. “My service to the country will not be as a candidate or as the nominee.”
O’Rourke, an El Paso native who shot to Democratic stardom in his strong but unsuccessful bid to unseat Republican Senator Ted Cruz last year, became a liberal firebrand on the campaign trail in 2019. He became a vocal supporter on issues of immigration reform, LGBTQ rights and gun violence in the wake of the Walmart shooting in his hometown.
He grabbed headlines at the Democratic Party’s September debate with his controversial proposal for a mandatory buyback program for assault weapons. Later that month at a forum hosted by the Human Rights Campaign, O’Rourke again drew conservative ire by vowing to revoke the tax-exempt status of churches that oppose same-sex marriage.
His decision to drop out comes on the same day that fellow Texan Julian Castro announced he had met his campaign’s 10-day fundraising goal of $800,000 that he said was essential to him staying in the race. Castro said the $1 million he raised in October would help him focus on trying to make the next Democratic debates in November and December.
O’Rourke has insisted for months that he would not run for Republican Senator John Cornyn’s seat, and is still expected to stay out of that race, which has attracted high-profile Democrats including state Senator Royce West and former state Senator Wendy Davis.
O’Rourke said Friday that he would work to ensure that the eventual Democratic nominee is successful in defeating President Donald Trump in 2020.
“I can tell you firsthand from having the chance to know the candidates, we will be well served by any one of them, and I’m going to be proud to support whoever that nominee is. And proud to call them president in January 2021, because they will win,” he said.
Texas Democratic Party Chair Gilberto Hinojosa called O’Rourke “a fighter, advocate, and leader.”
“Beto O’Rourke has done amazing things for the Democratic Party in Texas, and we look forward to his future,” Hinojosa said in a statement.
Copyright © 2019 courthousenews.com


General Election: Labour's four day week 'to be introduced within a decade'
Shadow chancellor John McDonnell said the changed working conditions will apply to everyone, and 95% of people would not pay additional tax
by George RyanLabour's shadow chancellor says all employees will work a 32 hour week in just a decade.
John McDonnell outlined plans to slash the working week to four days in central London today.
And he said 95% of taxpayers would pay no additional tax under the proposal.
The move would not lead to loss of earnings, Labour says.
Mr McDonnell rubbished fears it would damage the economy and lead to job losses, saying the change would be "planned and negotiated".
He stated: "It's a 32-hour working week, implemented over a 10-year period. It will apply to everybody."
And he continued: "The Tories have given this impression that we get elected on December 12... that on December 13 suddenly everybody is on a four-day week.
"No, that's not what we said."
He compared the move to the introduction of the minimum wage under the Tony Blair government, which was opposed by the Tories at the time.
Mr McDonnell said: "It's a bit like the implementation of the minimum wage, which was opposed then - if you remember - saying it will cost thousands of jobs and the economy would collapse etc.
"What we've said, just like every other reduction in the working week, it is planned and negotiated between employers and trade unions over time.
"We've said, realistically, as we put this investment into our economy, we will become more productive, there will higher wages, because of the higher skills that we're producing, and over time as the economy grows we want - as that wealth is created - a proportion of that wealth should be shared more fairly with the workforce.
"And we can share it in two ways. Higher wages, of course, but also traditionally what the trade unions in this country have negotiated to do is a shorter working week."
Mr McDonnell also outlined Labour's tax proposals which will be set out further when its manifesto is published.
Echoing its 2017 manifesto, Mr McDonnell said 95% of taxpayers would pay no additional tax.
He said: "The day-to-day funding increase will be funded by taxing, yes, the top 5% a higher rate of income tax.

"As I've said before, income tax rates, national insurance and VAT will not increase for 95% of earners. It's only the top 5% we will ask to pay a little bit more."


org.flexiblepower.messaging
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Port
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
name
The name of the port.
|
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
accepts
Specifies the type of objects that can be received through this port.
|
Cardinality |
cardinality
Specifies the cardinality of this port.
|
java.lang.Class<?>[] |
sends
Specifies the type of objects that can be sent through this port.
|
public abstract java.lang.String name
Endpoint.onConnect(Connection)
method to determine which port
has been connected to. Should be unique for the Endpoint.
This is the only required part of a Port
. If no sends()
or accepts()
is defined, the
port has been defined without any implementation (like an interface). This is useful for specifying on an
interface that should use a specific port.public abstract java.lang.Class<?>[] sends
ConnectionManager
will detect
which ports can be connected to each other, it will check if this set is a subset of the other accepts()
set. The implementation of the Endpoint
should never sent other types of objects through this port,
otherwise the behavior is unspecified (possible throws ClassCastExceptions).public abstract java.lang.Class<?>[] accepts
Connection
, the MessageHandler
should only receive objects of this types.public abstract Cardinality cardinality
Cardinality.SINGLE
, only one Connection
can be created on this port at the same time. If it is set to Cardinality.MULTIPLE
, multiple connections
are possible and should be handled by the Endpoint.onConnect(Connection)
method.


keep compliance with updated resource from various sources.
What is money laundering?
Money laundering is the conversion of the proceeds of criminal activity into apparently clean funds, usually via the financial system. This is done by disguising the sources of the money, changing its form, or moving the funds to a place where they are less likely to attract attention.
“Criminal activity” includes fraud, corruption, drug dealing and other serious crimes.
What is terrorist financing?
Terrorist financing is the provision or collection of funds, by any means, directly or indirectly, with the intention or in the knowledge that they would be used in order to carry out terrorist offences.
How the EU directive complies with FATF revised international standards?
Consolidating the risk-based approach: The new standards put more focus on the risk-based approach. This means that countries need to clearly understand the money laundering and terrorist financing risks which affect them, and adapt their Anti Money laundering/Counter Financing of Terrorism (AML/CFT) system to the nature of these risks – with enhanced measures where the risks are higher and the option of simplified measures where the risks are lower. Thus, countries will be able to target their resources more effectively and apply preventative measures that correspond to the risks of particular sectors or activities. A well-implemented risk-based approach means that the AML/CFT system will be more effective and less costly.
Improving Transparency measures: There is a lack of transparency at the moment around the ownership of companies, making them potentially vulnerable to misuse by criminals and terrorists. The new Recommendations have strengthened transparency requirements. Reliable information available about the ownership and control of companies, trusts, and other legal persons or legal arrangements is required as well as more rigorous requirements on the information which must accompany electronic funds transfers.
Towards more effective International Cooperation: With the increasing globalisation of money laundering and terrorist financing threats, the FATF has also enhanced the scope of international cooperation between government agencies, and between financial groups (e.g. simplified extradition mechanisms). The revised Recommendations will allow more effective exchanges of information, tracing, freezing, confiscation and repatriation of illegal assets.
Identification of clear Operational Standards: The FATF Recommendations concerned with law enforcement and FIUs have been expanded significantly. The revisions clarify the role and functions of the operational agencies responsible for combating money laundering and terrorist financing; and set out the range of investigative techniques and powers which should be available to them.
New threats & new priorities to be covered: The FATF has also addressed new and aggravated threats and responded to the priorities set out by the international community, e.g. through the G20, in particular:
Corruption & Politically Exposed Persons: The FATF Recommendations tighten the requirements on “politically exposed persons”; i.e. people who may represent a higher risk of corruption by virtue of the positions they hold. The requirement to apply enhanced due diligence to foreign politically exposed persons has been expanded with the new Recommendations also applying to domestic politically exposed persons and international organisations, and to the family and close associates of all politically exposed persons – reflecting the methods used by corrupt officials and kleptocrats to launder the proceeds of corruption.
Tax Crimes The list of predicate offences for money laundering has been expanded to include tax crimes which are brought within the scope of the powers and authorities used to combat money laundering. This will contribute to better coordination between AML and Tax authorities, and remove potential obstacles to international cooperation regarding tax crimes.
Terrorist Financing The financing of terrorism remains a serious concern for the international community, and a major focus of the FATF. The Recommendations reflect both the fact that terrorist financing is a long-standing concern, and the close connections between anti-money laundering measures and measures to counter the financing of terrorism.
For more information, please check EU’s Website


{% extends "layout.html" %}
{% block page_title %} Apply for European Structural and Investment Funding {% endblock %}
{% block content %}
{% include "includes/phase_banner_alpha.html" %}
Call OC04R15P0002
Application overview
-
About your organisation
complete
edit
-
Project Partners
complete
edit
-
About your project
complete
edit
-
Strategy
complete
edit
-
Financial
complete
edit
-
Deliverables
error
edit
-
Project management and control
review
edit
-
Compliance
not started
edit
-
Call reference
OC04R15P0002
-
Application Type
Full
-
Created
07 November 2015
-
Progress
5 of 8 sections completed
-
Status
Incomplete
{% endblock %}


Creating a pgAgent Job¶
pgAgent is a scheduling agent that runs and manages jobs; each job consists of steps and schedules.
To create or manage a job, use the pgAdmin tree control to browse to the server on which the pgAgent database objects were created. The tree control will display a pgAgent Jobs node, under which currently defined jobs are displayed. To add a new job, right click on the pgAgent Jobs node, and select Create pgAgent Job… from the context menu.
When the pgAgent dialog opens, use the tabs on the pgAgent Job dialog to define the steps and schedule that make up a pgAgent job.
Use the fields on the General tab to provide general information about a job:
Provide a name for the job in the Name field.
Move the Enabled switch to the Yes position to enable a job, or No to disable a job.
Use the Job Class drop-down to select a class (for job categorization).
Use the Host Agent field to specify the name of a machine that is running pgAgent to indicate that only that machine may execute the job. Leave the field blank to specify that any machine may perform the job.
Note
It is not always obvious what value to specify for the Host Agent in order to target a job step to a specific machine. With pgAgent running on the required machines and connected to the scheduler database, you can use the following query to view the hostnames as reported by each agent:
SELECT jagstation FROM pgagent.pga_jobagent
Use the hostname exactly as reported by the query in the Host Agent field.
Use the Comment field to store notes about the job.
Use the Steps tab to define and manage the steps that the job will perform. Click the Add icon (+) to add a new step; then click the compose icon (located at the left side of the header) to open the step definition dialog:
Use fields on the step definition dialog to define the step:
Provide a name for the step in the Name field; please note that steps will be performed in alphanumeric order by name.
Use the Enabled switch to include the step when executing the job (True) or to disable the step (False).
Use the Kind switch to indicate if the job step invokes SQL code (SQL) or a batch script (Batch).
If you select SQL, use the Code tab to provide SQL code for the step.
If you select Batch, use the Code tab to provide the batch script that will be executed during the step.
Note
The fields Connection type, Database and Connection string are only applicable when SQL is selected because Batch cannot be run on remote servers.
Use the Connection type switch to indicate if the step is performed on a local server (Local) or on a remote host (Remote). If you specify a remote connection should be used for the step, the Connection string field will be enabled, and you must provide a libpq-style connection string.
Use the Database drop-down to select the database on which the job step will be performed.
Use the Connection string field to specify a libpq-style connection string to the remote server on which the step will be performed. For more information about writing a connection string, please see the PostgreSQL documentation.
Use the On error drop-down to specify the behavior of pgAgent if it encounters an error while executing the step. Select from:
Fail - Stop the job if you encounter an error while processing this step.
Success - Mark the step as completing successfully, and continue.
Ignore - Ignore the error, and continue.
Use the Comment field to provide a comment about the step.
Use the context-sensitive field on the step definition dialog’s Code tab to provide the SQL code or batch script that will be executed during the step:
If the step invokes SQL code, provide one or more SQL statements in the SQL query field.
If the step performs a batch script, provide the script in the Script field. If you are running on a Windows server, standard batch file syntax must be used. When running on a Linux server, any shell script may be used, provided that a suitable interpreter is specified on the first line (e.g. #!/bin/sh).
When you’ve provided all of the information required by the step, click the compose icon to close the step definition dialog. Click the add icon (+) to add each additional step, or select the Schedules tab to define the job schedule.
Click the Add icon (+) to add a schedule for the job; then click the compose icon (located at the left side of the header) to open the schedule definition dialog:
Use the fields on the schedule definition tab to specify the days and times at which the job will execute.
Provide a name for the schedule in the Name field.
Use the Enabled switch to indicate that pgAgent should use the schedule (Yes) or to disable the schedule (No).
Use the calendar selector in the Start field to specify the starting date and time for the schedule.
Use the calendar selector in the End field to specify the ending date and time for the schedule.
Use the Comment field to provide a comment about the schedule.
Select the Repeat tab to define the days on which the schedule will execute.
Use the fields on the Repeat tab to specify the details about the schedule in a cron-style format. The job will execute on each date or time element selected on the Repeat tab.
Click within a field to open a list of valid values for that field; click on a specific value to add that value to the list of selected values for the field. To clear the values from a field, click the X located at the right-side of the field.
Use the fields within the Days box to specify the days on which the job will execute:
Use the Week Days field to select the days on which the job will execute.
Use the Month Days field to select the numeric days on which the job will execute. Specify the Last Day to indicate that the job should be performed on the last day of the month, irregardless of the date.
Use the Months field to select the months in which the job will execute.
Use the fields within the Times box to specify the times at which the job will execute:
Use the Hours field to select the hour at which the job will execute.
Use the Minutes field to select the minute at which the job will execute.
Select the Exceptions tab to specify any days on which the schedule will not execute.
Use the fields on the Exceptions tab to specify days on which you wish the job to not execute; for example, you may wish for jobs to not execute on national holidays.
Click the Add icon (+) to add a row to the exception table, then:
Click within the Date column to open a calendar selector, and select a date on which the job will not execute. Specify <Any> in the Date column to indicate that the job should not execute on any day at the time selected.
Click within the Time column to open a time selector, and specify a time on which the job will not execute. Specify <Any> in the Time column to indicate that the job should not execute at any time on the day selected.
When you’ve finished defining the schedule, you can use the SQL tab to review the code that will create or modify your job.
Click the Save button to save the job definition, or Cancel to exit the job without saving. Use the Reset button to remove your unsaved entries from the dialog.
After saving a job, the job will be listed under the pgAgent Jobs node of the pgAdmin tree control of the server on which it was defined. The Properties tab in the main pgAdmin window will display a high-level overview of the selected job, and the Statistics tab will show the details of each run of the job.
To modify an existing job or to review detailed information about a job, right-click on a job name, and select Properties from the context menu.


This faucet allows you to obtain Vertcoin Testnet coins easily. Once you are done with the coins, you can send them back to the faucet's address (shown on the right) allowing other people to use the coins in future testing.
Please enter your address below to request the testnet coins. You will receive 5 VTC:


{% extends "base.html" %} {% block content %} {% if user.is_authenticated %}
You are logged in as {{user}}.
Please login to see this page.
Login