text:
from Women Around the World and Women and Foreign Policy Program
Women This Week: Women Ministers in MENA
Egypt's Minister of Social Solidarity Ghada Wali talks during an interview with Reuters at her office in Cairo. REUTERS/Mohamed Abd El Ghany
Welcome to "Women Around the World: This Week," a series that highlights noteworthy news related to women and U.S. foreign policy. This week's post, covering June 16 to June 23, was compiled with support from Lucia Petty and Rebecca Turkington.
Blog Post by Rachel B. Vogelstein
Egypt and Jordan Appoint Record Number of Women Ministers
Egyptian Prime Minister Mostafa Madbouly announced his new government, including eight women ministers, who comprise a historic 25 percent of the cabinet. The same week in neighboring Jordan, activists celebrated a record number of women ministers, with 7 appointments of 29 cabinet seats in the new government given to women. Despite growing numbers, female government officials are less likely to hold positions with greater political clout, such as ministers of foreign affairs, defense and justice. Egypt is no exception, and new women ministers have primarily portfolios that are traditionally held by women, including social solidarity, culture, tourism, environment and health.
Iranian Women Permitted in Sporting Stadium
The same week that 10,000 Iranian women travelled to Russia to see Iran play in the World Cup, the Iranian Interior Minister allowed women into the Azadi Stadium for the first time in 37 years to watch a televised game. Many who travelled to Russia to see their team play used the World Cup as a platform to protest the longstanding unofficial ban on women entering stadiums. This isn't the first time that soccer has illuminated the restrictions that women face in Iran: in 2015, Niloufar Ardalan, an Iranian soccer star, wasn't able to compete in an international tournament because her husband refused to grant permission.
Domestic Workers Protest in Hong Kong
Women and Women's Rights
Women's Political Leadership
Last week, domestic workers in Hong Kong held a historic march to demand better living and working conditions. The protests came ahead of International Domestic Workers' Day, dedicated to the over 67 million domestic workers worldwide—80 percent of whom are women—who generally have lower wages, and fewer benefits or legal protections than other workers. The 380,000 domestic helpers in Hong Kong are under a government-regulated contract that offers very few legal and social protections. Migrating for domestic work is often the best option for women to make a living, but working conditions fall far below labor standards set for other industries.
How Sports Can Move the Ball for Women's Rights Around the World
Women This Week: 2019 Year in Review
Top Conflicts to Watch in 2020: A Mass Casualty Terrorist Attack on the United States or a Treaty Ally


Every year millions of men, women and children leave their homes — often risking everything to do so. What they seek is safety and/or the means to secure a better future. The number of international migrants worldwide has continued to grow over the past fifteen years. The movement of people between Africa and Europe and within Africa is significant. This can present opportunities and challenges not only for migrants themselves, but also for countries and their governments.
Today, Africa and Europe are working together, striving to create a positive impact on both continents. With a budget of 18,5 Million Euro, the European Union funds a project to support the Africa-EU Migration Mobility Dialogue (or MMD) — a part of the Joint Africa-EU Strategy, which is implemented by the International Centre for Migration Policy Development.
The MMD support project's main goal is to create a meaningful partnership on migration cooperation between the two continents. It supports migration dialogues, helps to build the capacities to address migration challenges, monitors and reports action and strengthens the role of the Africa Diaspora. The project works with the belief that migration is a global challenge, which can only be tackled through joint action. In this way, collectively we can we make migration better.
The Rabat Process, Khartoum Process, Joint Valletta Action Plan monitoring and reporting (JVAP), Continental Dialogue as well as Africa-EU Diaspora Development Platform (ADEPT) all come together to form the MMD support project.
For more than a decade, the Euro-African Dialogue on Migration and development, also known as the Rabat Process, has been enabling political cooperation on crucial migration and mobility issues between 58 countries affected by the major migratory routes linking Central, West and Northern Africa with Europe.
In November 2014, European States and States of the Horn of Africa amplified their efforts for political cooperation introducing a new dialogue to migration community: the EU-Horn of Africa Migration Route Initiative, also known as the Khartoum Process.
At the 2015 Valletta Summit, concrete and operational measures were agreed by African and European partners through the adoption of a political Declaration and a common action plan namely the Joint Valletta Action Plan (JVAP) to together face the challenge of migration as well as to recognise its benefits.
The Rabat and Khartoum Processes were mandated to follow-up on the concrete implementation of the JVAP, which translated operationally in the set-up of a database compiling all initiatives taken since November 2015 and related to the 5 domains of the JVAP. You can consult the database here.
Read more about JVAP in EN here and here, in FR here.
Diaspora communities have become increasingly recognised as a valuable resource for sustainable development and migration management. In light of this, the MMD support project facilitates the establishment and development of the Africa-Europe Diaspora Development Platform (ADEPT) to enhance diaspora engagement through capacity building and dialogue.
Read more on ICMPD's diaspora activities here.


text:
Q: Border in DrawRectangle Well, I'm coding the OnPaint event for my own control and it is very nescessary for me to make it pixel-accurate.
I've got a little problem with borders of rectangles.
See picture:
removed dead ImageShack link
These two rectangles were drawn with the same location and size parameters, but using different size of the pen. See what happend? When border became larger it has eaten the free space before the rectangle (on the left).
I wonder if there is some kind of property which makes border be drawn inside of the rectangle, so that the distance to rectangle will always be the same. Thanks.

A: If you want the outer bounds of the rectangle to be constrained in all directions you will need to recalculate it in relation to the pen width:
private void DrawRectangle(Graphics g, Rectangle rect, float penWidth)
{
    using (Pen pen = new Pen(SystemColors.ControlDark, penWidth))
    {
        float shrinkAmount = pen.Width / 2;
        g.DrawRectangle(
            pen,
            rect.X + shrinkAmount,   // move half a pen-width to the right
            rect.Y + shrinkAmount,   // move half a pen-width to the down
            rect.Width - penWidth,   // shrink width with one pen-width
            rect.Height - penWidth); // shrink height with one pen-width
    }
}

A: You can do this by specifying PenAlignment
Pen pen = new Pen(Color.Black, 2);
pen.Alignment = PenAlignment.Inset; //<-- this
g.DrawRectangle(pen, rect);

A: This isn't a direct answer to the question, but you might want to consider using the ControlPaint.DrawBorder method. You can specify the border style, colour, and various other properties. I also believe it handles adjusting the margins for you.

A: I guess not... but you may move the drawing position half the pen size to the bottom right

redpajama_set_name: RedPajamaStackExchange


text:
Eudorylas albucus är en tvåvingeart som först beskrevs av Hardy 1968.  Eudorylas albucus ingår i släktet Eudorylas och familjen ögonflugor. Inga underarter finns listade i Catalogue of Life.

Källor

Ögonflugor
albucus

redpajama_set_name: RedPajamaWikipedia


Our Roses 5 Light Chandelier is a spectacular display of floral beauty! Loads of sparkly crystal prisms and fancy-cut glass bobeches, along with blush-pink porcelain roses in full bloom make this chandelier a true vision of romance! Our chandelier comes complete with a ceiling cover and long painted chain. Beautiful indeed!


3-Impact on agriculture and desertification.
9-Climatic feedback of desert dust aerosols on African monsoon and East Asia.
Our ICTP-RegCM was developed in order to help generate high-resolution climate change information for as many regions of the world as possible. The intention is to make ICTP-RegCM freely available to groups of developing countries in order that they may develop climate change scenarios at national centres of excellence, simultaneously building capacity and drawing on regional climatological expertise. These scenarios can be used in impact, vulnerability and adaptation studies, and to aid in the preparation of National Communications.
For much more detailed information about ICTP-RegCM please view the ICTP-RegCM web site http://users.ictp.it/RegCNET/ .


text:
15620 W Dixie Hwy, North Miami Beach, FL 33162
Sat: 8am - 3pm | Sun: Closed
Cooling System Repair
On average, a four-cylinder vehicle travelling at a speed of 50 mph will produce 4,000 explosions per minute in its engine. These explosions create a massive amount of heat that could destroy the engine if not controlled properly–that's where the cooling system comes in. A vehicle's cooling system circulates a liquid coolant through the engine and then out to the radiator where it is cooled by air coming through the front grill. The main components of a cooling system include passages within the engine block and heads, a water pump to circulate coolant, a thermostat to monitor coolant temperature, and a radiator to cool the liquid after it has travelled through the engine. As the anti-freeze travels through these passages, it picks up heat from the engine and carries it away to the radiator where it is cooled. Once cooled, the liquid is sent back through the engine. It's important to maintain coolant levels to prevent engine overheating and potential damage. At Auto Services of North Miami Beach, we recommend that coolant be changed every 24,000 miles and that any cracked, leaking, or brittle hoses be replaced at the same time. There are specific requirements for mixing coolant, if you feel unsure about them bring your car to our service and repair center located in North Miami Beach, FL—we're always happy to help!
Engines generate an enormous amount of heat and must be cooled continuously to function properly. The vehicle's cooling system controls engine heat by circulating a liquid coolant throughout the engine. Eventually, however, the coolant will become too hot and will have to cool off. When this occurs, the coolant is transferred to the radiator, which is located at the front of the vehicle near the grill. Once in the radiator, air coming in from the grill cools the fluid. Once fully cooled, the process will start over and the fluid will be re-circulated throughout the engine. Without the radiator, the coolant would continue to circulate and would eventually cause the engine to overheat. Overtime, leaks can form in different components of the radiator. At the first sign of leaks it's important to have them fixed to prevent expensive damage to the engine. Auto Services of North Miami Beach prides itself on providing the North Miami Beach, FL area with superior service at the best possible price. If you're experiencing any issues with your radiator, come by Auto Services of North Miami Beach, our expert technicians are happy to help!
The cooling system's thermostat is simply a valve measures and regulates the temperature of coolant. The purpose of coolant is too cool off the engine as it burns fuel. It does this by circulating through the engine, absorbing heat, and carrying it to the radiator. Once in the radiator, the coolant is cooled by the air stream from the vehicle's grill and then re-circulated through the engine. The thermostat's job is to determine when the coolant has absorbed enough heat from the engine and can be released into the radiator and vice versa. If it's not hot enough, the thermostat will seal the radiator, forcing the coolant to circulate throughout the engine. If the coolant is too hot in the radiator, it won't be released. If the thermostat is stuck open, the engine will run cooler than it should and use more fuel. Conversely, a thermostat that is stuck closed will cause the engine to overheat and could cause serious damage to the engine. Symptoms of a bad thermostat include a knocking sound when accelerating, low temperature gauge readings, overheating, decrease in fuel economy, and a malfunctioning heater. If you experience any of these issues, bring your car in a soon as possible. Auto Services of North Miami Beach's service and repair center is located in North Miami Beach, FL.
As the engine burns fuel to generate mechanical force it creates an enormous amount of heat. If not dealt with, this heat would destroy the engine within a matter of minutes. To solve this problem, a liquid is used that can withstand temperatures above 250 degrees without boiling and temperatures below zero without freezing. The liquid is generally a mixture of antifreeze and water that also contains additives to prevent rust and corrosion. This coolant is circulated through the engine where it picks up heat and carries it to the radiator. Once in the radiator, air coming in from the grill cools the liquid and it is re-circulated. Overtime, the coolant can become corrosive and, if not flushed, can cause problems in the cooling system. Corrosive coolant will eventually lead to overheating and coolant leaks. At Auto Services of North Miami Beach, we recommend that your vehicle's coolant be flushed on a regular basis to prevent unnecessary damage to the cooling system. Any leaking, brittle, spongy, or cracked hoses should be replaced before the antifreeze is replaced.
Auto Services of North Miami Beach | (305) 944-4975 | 15620 W Dixie Hwy North Miami Beach, FL 33162

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: How to pass value of array from one Activity to other? I am building an android application where an user select their favorite stuff.
The name of stuff is added in an array when user clicks on the stuff's image.
Now I want to know how can I parse the value of that array to any fragment and show it in my spinner list.
For example: user select Mobile and tablet by clicking on respective images then these values added in to an array name 'stuffarray' now I want to pass this array to my fragment on an 'submitted' button and when I click on an spinner of my fragment it Should have mobile and tablet value in there list.
Here is my code for stuff selection :
I am building an android application where an user select their favorite stuff.
The name of stuff is added in an array when user clicks on the stuff's image.
Now I want to know how can I parse the value of that array to any fragment and show it in my spinner list.
For example: user select Mobile and tablet by clicking on respective images then these values added in to an array name 'stuffarray' now I want to pass this array to my fragment on an 'submitted' button and when I click on an spinner of my fragment it Should have mobile and tablet value in there list.
Here is my code for stuff selection :
submite = (ImageButton) findViewById(R.id.nextscreen);
next.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
    // TODO Auto-generated method stub

    Intent innext = new Intent(getApplicationContext(), MainActivitytabnew.class);

    startActivity(innext);

});
img1 = (ImageButton) findViewById(R.id.imageButton1);

 img1.setBackgroundResource(R.drawable.mobile);
 img1.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

     isClicked1=!isClicked1;
        if (isClicked1) {
            img1.setImageResource(R.drawable.mobile);
            start();
            stuff1 = "mobile";

               myList.add(stuff1);

        }else {
            img1.setImageResource(R.drawable.mobile);
            myList.remove(sport1);
            //sport1 = "";
            txt1.setText("");
        }
}
});

img2 = (ImageButton) findViewById(R.id.imageButton2);
img2.setBackgroundResource(R.drawable.tablet);
img2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

    isClicked2=!isClicked2;
    if (isClicked2) {
        img2.setImageResource(R.drawable.tablet);
        start();
        stuff2 = "tablet";
       myList.add(stuff2);
    }else {
        img2.setImageResource(R.drawable.tablet);
       // sport2 = "";
        myList.remove(sport2);
    }
}
});

A: Use putExtra():
int helloworld = 100;

Intent intent = new Intent( this, Class2.class );
intent.putExtra( "myInt", helloworld );
startActivity( intent );

then in your next activity use getExtra()
see documentation for intent.
int passedInt = getIntent().getExtras().getInt( "myInt" );

A: You could also set the value before you open it.
First activity
Intent intent = new Intent( this, YourOtherClass.class );
int[] myArray = { 0, 1, 2, 3 };
YourOtherClass.array = myArray;
startActivity( intent );

Second activity
public static int[] array;

Where this is your activity.


These pages list some members of the GICS group who have been kind enough to share their experiences on our website as a help to others who may be interested. All are happy to talk to new members about their experiences with GI Cancers. All members are contactable through the GICS group. If you wish to talk to someone who has gone (or is going) through a similar experience to your own, please email or telephone using the contact details for the group at the bottom of the HOME page.
Hello, I'm Philip – living proof that you can have a good and full life after the trials and tribulations of diagnosis and treatment.
I was first diagnosed with Oesophageal cancer in 2001, just one week before setting out for a three month sailing trip round the Black Sea to Russia. In fact, if it had not been for this trip I would not have been diagnosed so early. I was a healthy, fit, 55 year old, with no signs of any problems except for the need to straighten when eating, and it was my partner Pat (soon to become my carer!) who insisted I went to the Doctors for a check-up before leaving. He recognised that it could be serious and because of the short amount of time before leaving, I paid for a private X-ray and from that was diagnosed with cancer the day before leaving!
Even though this was back in 2001 and cancer services have improved dramatically since then, I received the best treatment on the NHS that I could have hoped for. The system and organisation was nowhere near as co-ordinated as it is today, but even so the professionalism and care provided by my oncologist, surgeon and nursing staff was the best of its day. I lived at Leigh-on-Sea at the time and had my treatment at Southend Hospital, which was then the cancer centre. I started with a six session Chemotherapy course to shrink the tumour, which I did not find too difficult, and was told to eat as much as possible (no problem – I managed to put on three stone!) My operation (by Francis Hughes, wonderful surgeon) lasted seven hours and involved removing my oesophagus and reforming my stomach into a tube to replace it. This is known as an Ivor Lewis and (for those who are interested), means major incisions below the belt and across the back, as can be seen from the photos below!
I spent the best part of the next week in the Intensive Care unit before embarking on the long road to recovery, hampered by the incision on my back that took time to heal. About six weeks after the operation, just when I was starting to regain my strength, I began a further course of Chemotherapy, which I found very difficult. This was part of a trial to see if chemo after an operation gave you a better chance of long term survival by getting rid of any spurious cancer cells released by the operation. Whether it does or not I don't know, but I wanted to have every chance possible; and am still here, although the effect of the chemo on my weakened body made me think I wouldn't be. I lost about five stone, and only just managed to survive the course.
However all that is behind me now. With loving care from Pat, my family and help from many friends, over the next year I regained my strength and returned to a full active life. I continue with my sailing and have been lucky enough to travel extensively. I have not had any residual problems from the cancer, only the effects from the major re-arrangement of my plumbing, which I have learnt to live with. I wish I had kept a better log of my recovery over the years, but all I can say is that I noticed significant improvements each year for a least the first five years and even now notice changes (but some of these may be due to old age!).
I always enjoyed my food, and still do. I can eat most things, but quantity sometimes becomes an issue as I no longer have the reservoir of a stomach to cope. Little and often is definitely the right approach if you can adopt it. I can eat spicy foods, (and have been to India at least four times) but they do have known adverse effects (!), and enjoy beers and spirits. Wines, however, unless they are very sweet like hocks, I find very acidic and have to water them down to drink them. My weight remains constant at about nine stone, so I do not carry much fat, which makes cold weather very uncomfortable. However I seem to have energy to do all I want to do and my overall health is excellent – I just do not seem to suffer from the aches, pains and ailments that seem to affect many of my peers.
I am a founder member of GICS and pleased to see it go from strength to strength, giving support to so many and making new friends on the way. I also sit as a "User Representative" on various NHS committees giving the patient viewpoint. This is a very rewarding activity and I would encourage anyone reading this to consider volunteering since it is a way of improving NHS services for other cancer patients. After all, we have been through it and understand better than anyone what is involved, what is important to patients and are therefore well placed to advise on how decisions being made can affect us. The NHS welcomes these views and has places for "User Reps" on most of its committees.
If anyone wants to talk to me further, either about experiences / effects of Oesophageal cancer, or getting involved with User Representation I would be pleased to talk to them. I can be contacted through the GICS organisation.
Me, a week after the operation in 2001!! And, now. With my wonderful wife, Pat.


Wendy learned the importance of giving back at a young age. Now, she unleashes her local love by helping kids like Emily finish high school.
I came home from school one day and my mom was in the kitchen. I looked in the living room and noticed our couch was missing.
It turned out that my dad had learned about a parent in our school who had fled an abusive situation in her home. She and her kids had found a new place to live, but they didn't have any furniture. So he came home and loaded up our sofa—one of those big sectionals—put it in the back of the truck, and took it over to her place.
This wasn't the only time something went missing from our house because my dad was helping someone. That story stayed with me throughout the years. My dad's example sent an important message to me at a young age: When people need help, we help them. That's the house I grew up in.
I went to an initial meeting and heard a couple of amazing speakers talk about the work United Way was doing in the community, including some of the work they were doing with vulnerable youth to help them finish high school.
Providing support to young people—through things like food programs and counselling—allows them to focus on school, and that is such an important step. Completing high school is a big gateway into so many other things in life. That support is crucial to help kids realize their potential.
If we can unleash that untapped potential in our community, the world's going to change. All it takes is, 'Yeah, I'm in'.
When I was in grade 11, I had a big falling-out with my family and ended up moving out. After I left my family home, I felt really overwhelmed by having to manage school and life. Just getting to school was a challenge on its own, even without the homework. And there was a lot of homework, because I was in advanced placement classes. I was falling behind. I would get the bare minimum done and I missed so many assignments. My attendance record was bad.
I want to be a role model for my two younger brothers. I want to give them hope and make them believe that, even if things seem a little challenging now, they can graduate. With the help of people who can give them a safe space to work on their homework and the guidance that they need to understand their schoolwork, they can follow their dreams. They can graduate and go as far as they want to.
And I want young women to understand that, as scary as life may be and as many obstacles as we face, if they really believe they can succeed and they have the resources around them to make success possible, there's no way they're going to fail.
I've had to take a complete detour, and I've had to do a lot of things differently in order to get to where I want to be. It's been very challenging, but it's definitely been worth it.


Excellent audio guide in English / Chinese. Shanghai Museum was founded in 1952, in the gallery of the old racetrack concession international collections were then installed in the Art Deco building in red brick facing, at the corner of Henan Lu and Yan'an Dong read before being transferred in this building.
The building, funded in part by donations from overseas Chinese, includes eleven galleries of permanent exhibits, organized on four floors. Structure evokes ding tripod bronze dating from Late Antiquity. It was used to cook food. The museum houses one of the largest collections of Chinese artifacts in the world, rivaling the Taiwan Museum in Taipei. It is by far the best in the country.
On the first floor gallery of ancient bronzes, has one of the finest collections of objects in the world, exposing the rarest pieces: some of the Xia Dynasty (XXI – sixteenth century BC) Such dishes and weapons. gallery of ancient sculptures, on the same floor, this beautiful pottery and bronze sculptures.
The second stage brings together ceramics from the Neolithic period to the Qing dynasty. We see beautiful pieces from the Tang Dynasty, ceramic glazed Sancai the three colors, as well as the famous blue and white Ming porcelain. The third floor is dedicated to Chinese prints, reflections of the Tang, Song, Yuan, Ming and Qing finally. A room together seals jade, ivory, amber and crystal used to affix his signature on letters and contracts.
The room shows the evolution of calligraphy writing, since the oracle inscriptions on tortoise shells, deciphered by oracles, manuscripts developed in the Qing Dynasty. Other rooms are dedicated to the 56 minorities living in China. Admire masks and clothing, while learning the customs of each ethnic group. Adjacent rooms deal with the evolution of numismatics.
The ticket costing 2.5 unit of Macao Macao dollar, $ 3 million to go to Taipa and Coloane $ 5 million.
The service is provided from 6:45 am to midnight every day. Maps showing bus routes are available at the tourist office.
Initially the ferry, bus No. 3, 3A or 10 lead, via the Avenida de Amizade has Lisboa Hotel and further up the Avenida Almeida Ribeiro, the main street, and Leal Senado Square. 3 takes you to the Chinese border to Portas de Cerco 3A and stops at Praca Ponte de Orta. You can also take the bus to go to the island of Taipa (28A, 21, 21A, 25, 26 and 26A from the center of Macao; 3.30 million), the Coloane (the same bus that go to on the island of Taipa, $ 5 million) and to the Hac Sa Beach (bus 26A; $ 5M).
Liaoning is a land of contrasts. Fortified cities of the Ming dynasty alongside resorts booming, an imperial palace stands in the center of Shenyang, the bustling provincial capital, and the unknown sections of the great wall along the border of North Korea, the country most reclusive world.
History and hedonism are associated in this corner of China relatively little visited, we once called Manchuria.
Sun lovers will enjoy the beaches Dalian or majestic buildings from the early XXth century testify to the colonial past of the region. In the evening, the shady streets come alive as people flock to the fish restaurants, bars and clubs. Still unknown, Xingcheng, one of the last four Chinese cities have retained all of its ramparts Ming is also possible by sunbathing and culture.
In Shenyang, the Qing imperial palace, the local version of the Forbidden City, Liaoning recalls that played a key role in the country's history. The city, which is trying to overcome its recent industrial past, has modern museums, ancient tombs, parks and a beautiful botanical garden.
North Korea's borders largely Liaoning. A Dandong, visitors can enjoy the pleasant mixture of Chinese and Korean cultures and discover the surroundings, the easternmost section of the Great Wall, is still preserved for tourists.
The relaxed atmosphere of Dalian, a beautiful colonial architecture and beaches.
The visa for French tourists is not necessary and any person in possession of a valid passport can stay for Macao has 90 days (entry on the territory of Macau requires a visa except for France and all European countries).
Persons in possession of a Hong Kong Identity Card, a Hong Kong Permanent Identity Card or Hong Kong Re entry Permit have the opportunity to stay a Macau for a maximum of one year. For travelers who need a visa, this one is obtained in immigration services for a maximum of 30 days. There are three types of visa.
Visa Individual: $ 100 million for unaccompanied persons, with a validity of 30 days. Children under 12 years pay $ 50M.
Visa Family: $ 200 million for couples of the same name, free for children under 12 years.


text:
package com.akamai.open.moonlighting.persistence.service.impl.dao.queries;

import com.akamai.open.moonlighting.persistence.service.Entity;
import com.akamai.open.moonlighting.persistence.service.impl.dao.EntityQuery;
import com.akamai.open.moonlighting.persistence.service.impl.dao.Query;
import com.akamai.open.moonlighting.persistence.service.impl.util.ClobUtil;
import com.akamai.open.moonlighting.persistence.service.impl.util.JsonUtil;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author Shreyas Dube <sdube@akamai.com>
 */
public class InsertEntityQuery extends EntityQuery {

    private final String workspace;
    private final String collection;
    private final String id;
    private final String propertiesJson;
    private final ClobUtil clobUtil = new ClobUtil();
    private final JsonUtil jsonUtil = new JsonUtil();

    public InsertEntityQuery(String workspace, Entity e) throws IOException {
        if (e == null) {
            throw new IllegalArgumentException("Entity cannot be null");
        }
        this.workspace = workspace;
        this.collection = e.getCollection();
        this.id = e.getId();
        propertiesJson = jsonUtil.toJson(e.getProperties());
    }

    @Override
    public String getQuery() {
        return Query.INSERT_ENTITY.getSql();
    }

    @Override
    public PreparedStatementInitializer getPreparedStatementInitializer() {
        return new PreparedStatementInitializer() {

            @Override
            public void initialize(Connection c, PreparedStatement s) throws SQLException {
                // set the workspace
                s.setString(1, workspace);

                // set the type
                s.setString(2, collection);

                // set the id
                s.setString(3, id);

                // set properties
                clobUtil.setClob(s, 4, propertiesJson);
            }
        };
    }

}

redpajama_set_name: RedPajamaGithub