New 12in MacBook 2016 release date, specs and rumours UK: No new MacBooks at Apple’s March event

Apple launched its incredibly thin and light 12in MacBook in March 2015 during the company’s Spring Forward event. Monday 21 March saw Apple host 2016’s Spring launch event, so naturally we expected to see a new MacBook one year on. Instead, Apple revealed the iPhone SE, a 9.7in iPad Pro and new Apple Watch straps, but no Macs. Read on for the latest 12in MacBook 2016 release date rumours and feature speculation.

New MacBook 2016 release date: When is the new 12in MacBook coming out?

The current new MacBook, which is really just called MacBook but was introduced as the new MacBook and we can’t shake it, was unveiled on 9 March on 2015 and then became available to buy on 10 April 2015. That means that it’s quite possible that the successor to Apple’s thinnest and lightest laptop could be right around the corner. But Apple hosted its Spring event on 21 March and there were no new Mac announcements at all.

Now we think it’s possible that Apple might use WWDC 2016 in June to demonstrate new MacBooks, or maybe the company will even sneak in a surprise update before then as sometimes happens without an event at all.

We’ll update this article with new information about the 12in MacBook’s release date as it emerges, so check back regularly for the latest information.

New MacBook 2016 rumours: What new features will the 12in MacBook have?

The current MacBook is an impressive machine, and it’s good-looking too. It’s available in familiar Gold, Silver and Space Grey colour options (although this represents the first time they’ve been used for a Mac rather than Apple’s iOS devices), and it’s an incredible 13.1mm thick. That’s 24 percent thinner than the MacBook Air.

Plus, it has a Retina display, a Force Touch Trackpad and a new butterfly mechanism beneath the individually lit keys on the super-thin keyboard. You can find out more about the Force Touch Trackpad and how it works here.

In a controversial move, the new MacBook also has just a USB Type-C port and a headphone jack. The USB C port offers power, USB 3.1, DisplayPort 1.2, HDMI and VGA capabilities in one single port, but that also means you’ll be likely to require adapters if you want to use more than one of those functions at once. Find out more about Apple’s USB-C adapters and adapters from third parties in our USB-C Adapters article.

Right now, the MacBook uses Intel’s 14nm Broadwell-Y Core M processor, and it’s likely that Apple will use a new Intel Core M processor for the new 2016 model of the MacBook. However, there has been some chatter about the possibility of an A10X processor for the laptop. We think the latter is unlikely, but we certainly can’t rule it out.

If our prediction is correct, the new MacBook will have Intel’s 14nm Core M chip. However, that could mean a wait until late in 2016 for the new MacBook if Apple wants the newest chips, as Intel’s tablet processor map suggests that the Core m5/m7 chips with the 14nm fabrication process are expected in the fourth quarter of 2016.

Will the 12in MacBook replace the MacBook Air?

Apple’s MacBook Air is now eight years old, so it’s quite possible that the MacBook is lining up to replace it in the near future. When the MacBook Air first launched its biggest selling point was its thin and light design, hence the name, but the MacBook now outshines it in those areas so it seems unlikely that the MacBook Air has much of a future ahead of it. Plus, for those looking for ultimate portability there’s the new iPad Pro with a 12.9in screen.

There is the question of price, though – the MacBook is much more pricey than its Air sibling, starting at £1,049 compared with the Air’s £749 starting price.

 

[Source:- Macworld]

Would you buy a small-screen premium Windows phone?

While we cover everything Microsoft on WinBeta, it was kind of hard to miss the usual media frenzy around Apple’s special event that happened last week. In case you were living on another planet, Apple released a new iPhone SE along a new iPad Pro, but we’ll only talk about the phone here. As usual, nearly every detail about the iPhone SE previously leaked in the press before the event, so the only surprise left was the $399 price, which is quite affordable for an iPhone with decent specs.

Apple is known for slowly iterating, and the iPhone SE features the same body as the 2013 iPhone 5S. But under the hood, the iPhone SE just looks like a repackaged iPhone 6S in a smaller form factor: both phones feature the same A9 Soc, 12MP iSight camera and 2 gigs of Ram. The only features the iPhone SE miss from its bigger sibling is the newer Touch ID sensor and the “3D Touch” screen technology that allow iPhone 6S users to access quick actions through hard presses. That doesn’t seem to be such a big deal, and the iPhone SE is still the cheapest premium iPhone ever. But of course, you have to be a fan of old-school 4-inch screens.

If the phone industry is gearing towards bigger flagship phones and “phablets”, smartphones with 4-inch screens are still very popular. It’s hard to deny it as there are still obviously a lot of old iPhones out there, but it’s also true for Windows phones as well. If you look at the latest worldwide stats from AdDuplex, the 4-inch Lumia 520 is still the most popular Windows Phone in the market with 12.1% market share. If we count all Lumias with an up to 4.5-inches screen in the latest AdDuplex stats (we count the Lumia 435, 520, 530, 630, 635, 920), we’re at 39% of all Windows phones worldwide! As a lot these phones won’t be updated to Windows 10 Mobile, it’s quite sad to left behind these small phones and the owners who love them.

AdDuplex Would you buy a small-screen premium Windows phone?

Small Windows phones are still very popular according to AdDuplex.

I think there is definitely a market for smaller premium phones because some people may care more about the specs and the camera than the big screen. Big screens are nice, but you may not need one if you don’t use your phone for gaming, reading, or other “content consumption” tasks. Also, they’re quite hard to use with one hand and they feel weird in your pocket. I think Apple is clearly acknowledging that, and I expect that a lot of old iPhone owners will likely choose to upgrade to the iPhone SE over the bigger iPhone models.

What about premium Windows phones? Well, back in June 2013, the Lumia 925 was the last Lumia flagship to ship with a 4.5-inch screen. The company moved to bigger flagships in the following months, first with the Lumia 1520 phablet which was soon followed by the 5-inch Lumia 930 in April 2014. Since then, Lumia fans have been forced to adapt to those bigger screens, as smaller devices like the 4-inch Lumia 435 or even the 4.7-inch Lumia 735 are compromised in one way or another (smaller memory, frustrating cameras, no dedicated camera buttons).

lumia435 Would you buy a small-screen premium Windows phone?

The Lumia 435 is one of the few remaining 4-inch Windows phones.

With its fifth generation of Lumias, Microsoft decided to focus its phone efforts on fewer models. The company released the big-screened Lumia 950 and 950XL for Lumia fans, but does every Lumia fan wants such a big screen? The cheaper Lumia 650, which actually looks like a bigger iPhone SE, also features a 5-inch screen. It’s definitely one of the best designed Lumias ever and it really deserves to succeed in the market, but I think it would have had a better shot at it if it was slightly smaller and cheaper. It’s also the first “metal” Lumia without a dedicated camera button, which doesn’t make a lot of sense when you remember that even the low-end Lumia 520 had one.

lumia650 Would you buy a small-screen premium Windows phone?

The Lumia 650 is one of the best-designed Lumias ever.

If you hope to find better alternatives from third-party OEMs, don’t hold your breath: the Alcatel Idol Pro 4, HP Elite x3 and Acer Jade Primo all feature screens bigger than 5 inches. Acer is rumored to be working on a mini version of the Jade Primo, but we have no more details on the handset yet.

So, we really want to know if you think the fifth generation Lumia is currently meeting everyone’s needs. And we really want to hear from our readers who love their old Lumia 920, 925 or 1020. Are you resigned to upgrade to a bigger phone, or will you keep looking for a small premium phone?

 

[Source:- Winbeta]

Microsoft is about to change Skype radically

Microsoft is about to change Skype radically

Microsoft has announced that it will soon release the preview version of the Skype Universal Windows Platform (UWP) app to Windows Insiders.

Testers running Windows 10 PCs and tablets will be able to check out the new messaging app in the “coming weeks”, Redmond says, so there’s not long to wait now. The app won’t immediately be usable on Windows 10 Mobile, but will follow for devices running that OS shortly.

So what can you expect from the new Skype app? Microsoft says it has learned a lot of lessons from the feedback given following the release of the consumer preview of Skype Integration in Windows 10 last autumn – which has seen a number of complaints.

One of the primary moans being the usability with larger screens on bigger tablets and hybrids, and desktop monitors, and of course that’s a big part of what the Skype UWP app will tackle.

Redmond promises a more streamlined interface all round, and a simplified look and feel for the app, with unnecessary menus and duplicated functions being stripped out.

There has been a good deal of spring cleaning, basically, and the global menus are now in a new single settings menu, with contextual menus promised down the line.

Skype UWP snap

Initial features

In the initial incarnation of this preview app, you’ll be able to sign in with your Microsoft account, link a Skype ID, and then see your list of Skype contacts with the ability to initiate a chat, make one-to-one calls, send photos, and take part in existing group chats.

Emoticons and emoji will be available, and users will also be able to see what the other person is typing in chats.

So functionality will be fairly basic for this first release, although naturally enough, more features will arrive in subsequent versions.

Microsoft says that the next couple of releases will introduce the ability to create groups and use group messaging, voice and video calling. You’ll also be able to share your screen, as well as files and video messages.

Another priority is making sure the app performs well and is responsive.

As for the broader future of Skype, if you want to stick with the existing Skype app on Windows 10 you most certainly can for the foreseeable, but eventually everything will be integrated into the UWP app.

But not before, Microsoft promises, the Skype UWP app becomes a high-quality and lightweight application with all features on-board.

 

[Source:- Techrader]

The Rollercoaster Reimagined: VR Ride Opens

Thomas Moore on VR Ride

The world’s first rollercoaster that’s fully synced with virtual reality has opened at Alton Towers.

Galactica uses motion sensors next to every seat to link the physical twists and turns to computer graphics played on headsets worn by the riders.

The video takes thrill seekers on a 189-second flight from a space station through an asteroid belt to the canyons of an alien world.

Simon Reveley from Figment Productions, which created the VR ride, said the link between the physical sensations and the virtual world makes for an immersive experience.

“We can amplify things,” he said.

A rollercoaster track blended with a space-like virtual reality image

Video: What’s A VR Rollercoaster Like?

“If we put you on a turn, we can turn you further than you are in the real world.

“As long as we accelerate at the right time, and match the turns, the rest is up for grabs.

“It means there’s a lot of fun to be had with the VR experience.”

We asked Becky Ervin to test the new experience.

She said: “You are going round, twisting and turning. But it’s what you are seeing through the headset that completely changes it.”

The ride at the Staffordshire theme park is a revamp of the Air rollercoaster.

Its launch comes shortly after the Smiler rollercoaster reopened, following a crash in June last year which left five people with life-changing or serious injuries.

Until now, rollercoasters have competed on superlatives.

The Ferrari Rossa in Abu Dhabi is the world’s fastest at 150mph. And the Kingda Ka in the United States is the tallest at 139m.

But Britain’s only “thrill engineer”, Professor Brendan Walker, said VR gives designers new options.

“You are putting a mask over your eyes so you can’t see the real world, so that is going to make you a bit anxious,” he said.

“Because the ride designer has scripted the VR experience to match the physical bodily experience the levels of immersion in the virtual world become even greater.”

Sky News tried the new ride – it is the rollercoaster reimagined.

But computer graphics can’t replace the adrenaline rush of seeing the track fall away and the real world flash by.
[Source:- Skynews]

 

Hazelcast Teams with Azul Systems

The Java Zone is brought to you in partnership with Azul.   Discover how to stop tuning and get back to coding with Azul Zing.

Azul and Hazelcast have been enhancing their products for many years in order to support demanding in-memory workloads. Hazelcast’s formal support for Zing® makes it even easier for enterprises to build and deploy memory-based webscale Java applications. Together, Hazelcast and Azul Systems will extend their existing success in latency-sensitive domains including financial services, ecommerce, online gaming, and real-time advertising networks.

The combination of Hazelcast plus Zing delivers compelling benefits to the enterprise. Beyond helping IT and DevOps teams leverage existing Java tools, technology and skillsets, Azul and Hazelcast greatly extend the operational lifetime and capacity of existing memory-intensive applications. In one recent example, a system that was constrained by a legacy Java Virtual Machine (JVM) could only support 40,000 line items, but was extended to support 1,500,000 in-memory catalogue entries simply by deploying Zing and with no change to the application – greatly improving the end-user experience and driving incremental sales within the same infrastructure.

Hazelcast provides a highly resilient and elastic memory resource to all applications, while supporting more production environments than any of its competitors. Its operational in-memory platform is written in Java, and is available in both Enterprise and community (open source) editions. The platform provides a high-speed, highly available and elastic cluster of memory servers that can be sized on-the-fly to match the changing needs of an application at webscale. Storing data in Hazelcast is as robust and flexible as storing it on disk with all the speed of keeping it in-memory. Hazelcast and Azul’s technologies are compliant with Java SE as well as Java EE, making it simple to deploy for large systems based upon Tomcat, Spring, and other top-tier frameworks and application servers.

To pilot Hazelcast with Zing in your operation, contact either Hazelcast or Azul Systems.

[Source:- Dzone]

New MacBook Air release date, specs and rumours UK: 13in and 15in MacBook Air with thinner design rumoured for WWDC

Apple last updated its MacBook Air in March of 2015 with a spec boost, we had been convinced that Apple was about to give the laptop a Retina display. Instead, it launched a brand-new MacBook line that’s super-thin, super-light and does offer that high-resolution display, but does that mean Apple won’t enhance the MacBook Air with a Retina display in the future? In this article we investigate the hints and clues pointing to an imminent MacBook Air update: including release date, specs & rumoured new features.

New MacBook Air 2016 rumours: MacBook Air UK release date

Apple hosted a special event on 21 March 2016, so ahead of the event we had naturally expected new MacBook Air and MacBook models. After all, the Spring event represented one year since both were last updated (or one year since it was first launched in the MacBook’s case) and before that new Air models arrived in April of 2014. But instead, Apple used the event to show off the iPhone SE and the iPad Pro with 9.7in screen.

Despite the lack of MacBooks at Apple’s 21 March event, the MacBook rumours haven’t slowed down. If anything, they’re hotting up as anyone looking to buy a new MacBook soon is feeling frustrated by the lack of any new models with the latest processors. But according to a DigiTimes report published just a day after the March event, new 13 and 15in MacBooks are coming.

The confusing thing about it is that these new MacBooks are said to have a similar design to the current 12in MacBook, but will have 13 and 15in displays. And they’ll apparently be thinner than the 11in and 13in MacBook Air models that we have now, too. That makes it tricky to know what MacBook line this rumour is actually referring to, or whether we’re going to get a complete shakeup of the MacBook lineup.

Our current thinking is that the 11in MacBook Air is about to be retired, and in its place we’ll see a 13in and 15in MacBook Air with redesigned internals and a thinner design.

Of course, the rumour could be completely false. DigiTimes is sometimes accurate, but also sometimes less reliable so it’s tricky to know. But if it is true, we’d expect the new MacBooks to emerge at WWDC in June.

We originally expected the MacBook Air to be updated with a Retina display on 9 March 2015 at Apple’s Spring Forward event. And were quite surprised when we got something else: a Retina MacBook, yes, but one with a 12in display and a USB-C port (and very few other ports), a new strand of products for Apple’s MacBook laptop line-up.

Less glamorously, Apple’s MacBook Air did get an update at the same time, with new, faster processors, faster flash storage and better graphics, but the screen and overall design remained the same. Still no Retina display for the Air line.

That left us wondering what Apple’s plans are for the future of its MacBook line-up. We think the company intends to replace the MacBook Air with the new MacBook eventually, but the MacBook Air could remain part of the line-up for some time yet, and could still get an upgrade to the Retina display when it’s refreshed in 2016.

But when is it going to be refreshed? Now that the March event has been and gone we expect Apple to wait for WWDC 2016 in June, or possibly sneak in an update before then without going to the trouble of hosting an event.

In late November 2015, a report from the Economic Daily News suggests that the MacBook Air will see a significant update in 2016. The report suggests that the update to the MacBook Air may not arrive until WWDC in June, which will be more than a year after Apple last updated the MacBook Air. According to the report, the new MacBook Air models are expected to come out in the third quarter of next year, which suggests that there may be a wait after the June unveiling.

The Economic Daily News report notes that it’s been eight years since the MacBook Air launched and it’s not been redesigned in that time, suggesting that time is ripe for a makeover, or perhaps it’ll be discontinued completely in favour of the new MacBook.

We’ll update this article as soon as we know more.

New MacBook Air 2016 release date rumours

New MacBook Air 2016 rumours: Price

The last time that there was a Mac laptop that had more advanced specs than a more expensive model was the old MacBooks (aluminium, then white and black, and then eventually aluminum again). These older MacBook models were eventually discontinued and the price of the MacBook Air was reduced to make it the new entry level (when the MacBook Air initially launched it was quite overpriced for the specs, just like the current Retina MacBook).

It seems likely that the same will happen with the new MacBook models eventually replacing the MacBook Airs, at a lower price, but for now that seems a long way off.

The Economic Daily News report suggests the new MacBook Air will cost more than it does currently when it does launch. The 11in MacBook Air starts at £749, while the entry level 13in model costs £849.

If the 11in MacBook Air is removed from the line up perhaps the cost of entry of the 13in model will reduce to the level that the 11in model is currently, with a rumoured 15in model coming in at a higher price.

New MacBook Air 2016 rumours: Dimensions

If Apple does update the MacBook Air range, what dimensions should we expect?

New MacBook Air 2016 release date rumours

As mentioned above, rumours suggest that the 11in MacBook Air will be discontinued, after all, the 11in MacBook Air is both smaller than the MacBook and the new iPad Pro.

However, 9to5Mac points out that the new 13in and 15in MacBook Air models could be additional sizes to the MacBook range. That site predicts that some time in 2016 or 2017 we will have just two ranges of Mac laptops: the MacBook at the ultraportable level, and the more advanced MacBook Pro. Maybe the 17in MacBook Pro will make a comeback too, with a 4K display.

New MacBook Air 2016 rumours: Specs & new features

These new MacBook Air models are said to be thinner and lighter, with internal spec enhancements. Apparently, the new MacBook Air will feature new batteries, cooling modules, and chassis, according to the Economic Daily News.

We also expect to see USB Type-C across the range, especially now that Intel has integrated Thunderbolt 3 into USB-C.

The next-generation MacBook Air is also likely to feature Intel Skylake processors, as well as graphics and RAM upgrades.

New MacBook Air 2016 rumours: Retina display

The suggestion that the MacBook Air will feature a Retina display has been long running but those rumours were prior to the launch of the 12in Retina MacBook and the iPad Pro – suggesting the signtings of the Retina display some thought was destined for the MacBook Air was instead for these models.

Does this mean that there will be no Retina display on the new MacBook Air when (or if) it launches. If Apple wants to keep the price down maybe not. Or perhaps the newly rumoured 15in Macbook Air will feature a Retina display, while the 13in model will lack the high res display, but come in at a lower price, one similar to the current price of the 11in MacBook Air.

New MacBook Air 2016 rumours: Touch ID and Force Touch

New MacBook Air 2016 rumours: Force Touch

There are also reports to suggest that it’ll boast Touch ID within its Trackpad, which may also get the Force Touch upgrade that was given to the 13in MacBook Pro on 9 March, and comes with the new MacBook.

Touch ID is the fingerprint sensor that’s built-in to the Home button of the iPhone 5S, iPhone 6 and iPhone 6 Plus. It’s also used to make Apple Pay more secure.

According to an Independent report, Touch ID for the Mac line would require a dedicated chip to be built in to the device.

The rumour started with Taiwanese blog AppleCorner, which cited sources in the supply chain. Apparently the Magic Mouse and Magic Trackpad may get a biometric update too, enabling users to make Apple Pay payments on the web, but both those accessories were updated alongside the launch of a new 4K iMac so that seems unlikely to happen any time soon.

New MacBook Air 2016 rumours: Will the MacBook Air be discontinued?

With the advent of the 12in MacBook and the new 12.9in iPad Pro, it’s no surprise that rumourmongers are starting to predict that the 11in MacBook Air, with a smaller screen than either of those devices, will be discontinued. The iPad Pro may indeed be viewed by Apple as a replacement for the 11in MacBook Air if Apple CEO Tim Cook’s comments to the Telegraph are taken into account (published on 1 December 2015).

Following the launch of the iPad Pro, Cook told the Telegraph: “I think if you’re looking at a PC, why would you buy a PC any more? No really, why would you buy one?

“Yes, the iPad Pro is a replacement for a notebook or a desktop for many, many people. They will start using it and conclude they no longer need to use anything else, other than their phones.”

However, should Apple discontinue the 11in MacBook Air, it does remove the lower price of entry from the line-up.

It may not just be the 11in MacBook Air that is discontinued. When the new MacBook launched on 9 March 2015, analysts began to suspect that the MacBook Air might not be around for much longer.

“This wasn’t the MacBook Air, but instead leaped past the Air,” said Jan Dawson, chief analyst at Jackdaw Research. “They kept the MacBook Air around just as they do with older iPhones, but the MacBook is now in the same position as the newest iPhone. That makes me wonder if the Air will go away over time.”

Carolina Milanesi, chief of research and head of US business for Kantar WorldPanel Comtech, also predicted a contraction of Apple’s line-up. “All [notebooks] need to be more mobile, so something like the Air doesn’t need to be branched out anymore,” she said of the differenciation Apple made for the line since its introduction more than eight years ago. “And it’s to Apple’s benefit not to have so many ‘families’ of Macs.”

Over time, it seems likely that the MacBook Air range could be discontinued and eventually replaced by a Retina MacBook range at a lower price.

We’ll be updating this article as more information about the rumoured Retina MacBook Air emerges so check back from time to time for the latest news.

Wondering which MacBook is best for you? Read: MacBook Air vs MacBook Pro comparison review: 13in Apple laptops compared

 
[Source:- Macworld]

Microsoft’s Skype UWP app is a big improvement over the Messaging app

 

 

Microsoft is currently working on a new Universal Windows App of Skype for Windows 10, which is set to replace the awful Messaging and Skype Video apps already available on Windows 10 today. WinBeta has had some hands on time with an unfinished version of the app, as so far we’re impressed.

The new UWP app for Skype is a huge improvement over the hilariously bad Messaging app we use currently. The new Skype app actually looks like Skype for starters, and has all the bells and whistles you would expect a Skype client to have, like an emoji-library, group conversations, file sharing, and more.

The new app has the option to sync Skype contacts with the People app, and right-click context menus that offer access to Skype profiles and other options. Since this is an early build of the new Skype app, it’s almost certain that more Skype features will be ported over from the desktop app in good time. But right now, the new Skype app is a very nice improvement over the current Messaging app, which we all know is pretty damn bad.

[Source:- Winbeta]

Best VR web browser: how to browse the internet in virtual reality

Best VR web browser: how to browse the internet in virtual reality

Samsung Gear VR

After years of trials, tribulations and terrible failures, VR is finally becoming a reality. Whether you are eying up an Oculus Rift or getting the vibes for HTC’s Vive, it’s not just the inevitable avalanche of VR games and video content that are suitable for virtual reality viewing – now you can browse the 2D web in 3D, too.

For those after that total immersive experience, we’ve rounded up the best VR web browsing options currently available.

 

[Source:- Techrader]

FBI Cracks San Bernardino Attacker’s iPhone

A local police cruiser drives by the home of Raheel Farook, brother of San Bernardino shooter Rizwan Farook, in Corona, California

The FBI has successfully accessed data stored on an iPhone belonging to one of the San Bernardino attackers.

As a result, the Justice Department has asked a court to withdraw an order compelling Apple to help access the phone, which is thought contain evidence relating to the massacre in December that killed 14 people.

Syed Farook and his wife Tashfeen Malik also wounded 22 others, before they were later killed in a gun battle with police.

US attorney Eileen Decker said in a statement: “Our decision to conclude the litigation was based solely on the fact that, with the recent assistance of a third party, we are now able to unlock that iPhone without compromising any information on the phone.”

Ms Decker added the government’s request was part of its “solemn commitment” to the victims of the attack, America’s worst since 9/11.

Tashfeen Malik and Syed Farook are pictured passing through Chicago's O'Hare International Airport in this July 27, 2014 handout photo

“Although this step in the investigation is now complete, we will continue to explore every lead, and seek any appropriate legal process, to ensure our investigation collects all of the evidence related to this terrorist attack,” she said.

It is unclear who helped the FBI access the phone and what was stored on the device.

The FBI said last week it may have found a way to break into Farook’s iPhone without Apple’s help.

Federal prosecutors said “an outside party” had come forward with a possible method for unlocking the encrypted phone.

The US government had obtained a court order requiring Apple to write new software to disable passcode protectors, which they can use on the phone.

But Apple fought the order, warning that the software could fall into the hands of hackers and threaten the security of all encrypted devices. The company has yet to comment on this latest development.

Apple

It said the demand violated its constitutional rights, would harm its brand and threaten the trust of its customers to protect their privacy.

In a statement, Apple said: “From the beginning, we objected to the FBI’s demand that Apple build a backdoor into the iPhone because we believed it was wrong and would set a dangerous precedent.

“As a result of the government’s dismissal, neither of these occurred. This case should never had been brought.

“We will continue to help law enforcement with their investigations, as we have done all along, and we will continue to increase the security of our products as the threats and attacks on our data become more frequent and more sophisticated.

“Apple believes deeply that people in the United States and around the world deserve data protection, security and privacy. Sacrificing one for the other only puts people and countries at greater risk.”

Numerous tech giants including Google, Facebook, Microsoft and Yahoo, publicly backed Apple, alongside civil liberties groups and privacy advocates.

 

[Source:- Skynews]

Spring Boot: Working With MyBatis

 

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

MyBatis is a SQL Mapping framework with support for custom SQL, stored procedures and advanced mappings.

SpringBoot doesn’t provide official support for MyBatis integration, but the MyBatis community built a SpringBoot starter for MyBatis.

You can read about the SpringBoot MyBatis Starter release announcement at http://blog.mybatis.org/2015/11/mybatis-spring-boot-released.html and you can explore the source code on GitHub https://github.com/mybatis/mybatis-spring-boot.

Create a SpringBoot Maven project and add the following MyBatis Starter dependency. 

<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>1.0.0</version>
</dependency>

We will be reusing User.java, schema.sql and data.sql files created in my previous article SpringBoot : Working with JdbcTemplate
Create MyBatis SQL Mapper interface UserMapper.java with few database operations as follows:

package com.sivalabs.demo.domain;
public interface UserMapper
{
    void insertUser(User user);
    User findUserById(Integer id);
    List<User> findAllUsers();
}

We need to create Mapper XML files to define the queries for the mapped SQL statements for the corresponding Mapper interface methods.

Create UserMapper.xml file in src/main/resources/com/sivalabs/demo/mappers/ directory as follows:

<!DOCTYPE mapper
    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sivalabs.demo.mappers.UserMapper">
    <resultMap id="UserResultMap" type="User">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="email" property="email" />
    </resultMap>
    <select id="findAllUsers" resultMap="UserResultMap">
        select id, name, email from users
    </select>
    <select id="findUserById" resultMap="UserResultMap">
        select id, name, email from users WHERE id=#{id}
    </select>
    <insert id="insertUser" parameterType="User" useGeneratedKeys="true" keyProperty="id">
        insert into users(name,email) values(#{name},#{email})
    </insert>
</mapper>

A few things to observe here are:

  • Namespace in Mapper XML should be same as Fully Qualified Name (FQN) for Mapper Interface
  • Statement id values should be same as Mapper Interface method names.
  • If the query result column names are different from bean property names we can use <resultMap> configuration to provide mapping between column names and their corresponding bean property names.

MyBatis also provides annotation based query configurations without requiring Mapper XMLs.

We can create UserMapper.java interface and configure the mapped SQLs using annotations as follows:

public interface UserMapper
{
    @Insert("insert into users(name,email) values(#{name},#{email})")
    @SelectKey(statement="call identity()", keyProperty="id",
    before=false, resultType=Integer.class)
    void insertUser(User user);
    @Select("select id, name, email from users WHERE id=#{id}")
    User findUserById(Integer id);
    @Select("select id, name, email from users")
    List<User> findAllUsers();
}

SpringBoot MyBatis starter provides the following MyBatis configuration parameters which we can use to customize MyBatis settings.

mybatis.config = mybatis config file name
mybatis.mapperLocations = mappers file locations
mybatis.typeAliasesPackage = domain object's package
mybatis.typeHandlersPackage = handler's package
mybatis.check-config-location = check the mybatis configuration exists
mybatis.executorType = mode of execution. Default is SIMPLE

Configure the typeAliasesPackage and mapperLocations in application.properties. 

mybatis.typeAliasesPackage=com.sivalabs.demo.domain
mybatis.mapperLocations=classpath*:**/mappers/*.xml

Create the entry point class SpringbootMyBatisDemoApplication.java.

@SpringBootApplication
@MapperScan("com.sivalabs.demo.mappers")
public class SpringbootMyBatisDemoApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(SpringbootMyBatisDemoApplication.class, args);
    }
}

Observe that we have used @MapperScan(“com.sivalabs.demo.mappers”) annotation to specify where to look for Mapper interfaces.

Now create a JUnit test class and test our UserMapper methods.

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(SpringbootMyBatisDemoApplication.class)
public class SpringbootMyBatisDemoApplicationTests
{
    @Autowired
    private UserMapper userMapper;
    @Test
    public void findAllUsers() {
        List<User> users = userMapper.findAllUsers();
        assertNotNull(users);
        assertTrue(!users.isEmpty());
    }
    @Test
    public void findUserById() {
        User user = userMapper.findUserById(1);
        assertNotNull(user);
    }
    @Test
    public void createUser() {
        User user = new User(0, "Siva", "[email protected]");
        userMapper.insertUser(user);
        User newUser = userMapper.findUserById(user.getId());
        assertEquals("Siva", newUser.getName());
        assertEquals("[email protected]", newUser.getEmail());
    }
}

 

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!
[Source:- Dzone]