When Ireland found itself at war in late 1914, hundreds of German men who were resident here had to be arrested as “enemy aliens”.

However inoffensive they might have been before, they were now a threat. As propagandists put it, the German hairdresser was “always a spy”, while the German waiter was a “born eavesdropper, subsidised by Satan the Second”.

One of the better known internees would later joke that his fellow prisoners represented the “cream of Dublin’s German pork butchers”. And there were indeed butchers among them, including William Youkstetter, whose North Strand premises is mentioned in Ulysses as having pigs’ puddings in “white, black, and red” (the colours of imperial Germany).

German clockmakers were numerous too. According to the 1901 census, Ireland had no fewer than 77. Now, like the barbers and butchers, these were all to be separated from their families and confined for the war’s duration in an old workhouse at Oldcastle, Co Meath.

The workhouse had been built in 1842, just in time for the Famine and the decades of impoverishment to come. Like the other “Poor Law Bastilles”, it was designed to keep inmates alive, but only just. Lest it become an attractive option for paupers, official policy ensured conditions there had to be at least as bad as anything outside.

But by 1914, the complex was largely empty. So for the next four years, it housed a new kind of guest: some 600 men who had been rendered suspect by birth in Germany or the Austro-Hungarian empire.

Butchers and clock-makers aside, another profession overrepresented in Oldcastle was music. The man who made the joke about the sausage-makers, Adolf Gebler, was a professional musician. So was Aloys Fleischmann, who had moved here after marrying a Cork woman of German extraction, Tilly Swertz.

Like Patrick Pearse’s father, Swertz’s had come to Ireland as an indirect result of the church-building boom that followed Catholic Emancipation. In his case, he was filling a vacuum for qualified musicians. When he moved to the US in 1906, his job as Cork Cathedral’s organist fell vacant, whereupon his son-in-law, Fleischmann, successfully applied, leaving a promising career in Dachau behind.

The German musical tradition in Oldcastle Camp gave rise to a local version of the football-among-the-trenches story. On New Year’s Eve 1914, music lovers in the area listened admiringly to the “harmonised singing of the Germans” as they celebrated the coming of 1915 with “patriotic choruses”.

Musicianship in the camp later extended to a chamber orchestra. But in most other respects, it remained a prison, to be endured painfully, or escaped if possible.

A few inmates did get out. Others were less lucky. One was shot dead while trying to escape in September 1916. A few months later, another was reported to have died in a “football accident”.

Fleischmann knew better. In his account, the alleged footballer had been searching for something near the perimeter wall when he was “bayoneted by a guard”.

For most prisoners, meanwhile, the greatest horror of internment was boredom. It drove some to madness, others to suicide. During a later incarceration, on the Isle of Man, Fleischmann was tortured by the constant quarrelling of inmates: “A sad and miserable existence”, he called it; “Not a minute’s peace by day or night”.

That he and the other Germans ended the war outside Ireland was a sign of the changed mood here from 1916 onwards. When Oldcastle’s prisoners were deported in June 1918, The Irish Times reported them being cheered at the Dublin docks by Sinn Féin supporters. This country could no longer be trusted to hold them. The Isle of Man was safer. A newspaper there greeted the arrival of “500 Huns”.

A century later, the internment of Germans is one of the more forgotten stories of Ireland’s war. Now a beautifully produced new book, Oldcastle Camp 1914-1918 – An Illustrated History, is bringing it back to life. Edited by Tom French of Meath County Library, it draws on a range of sources, including a centenary talk by the writer Carlo Gébler, grandson of Adolf who describes how the experience haunted his family over three generations.

But the book’s keynote chapter is a long essay by Ruth Fleischmann on her grandfather’s extraordinary life, before, during, and after internment. A prolific composer as well as a teacher, his later pupils would include one Seán Ó Riada. And along with Tilly Swertz, he also gave Ireland a son, Aloys Fleischmann jnr, who as Gébler writes, was “arguably the most important figure in twentieth century Irish classical music”.