From: Kai Moritz Date: Wed, 5 Jul 2017 23:20:38 +0000 (+0200) Subject: Fixed a bug when handling test-dependencies: XML-mappings were ignored X-Git-Tag: hibernate-maven-plugin-2.1.1~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=9907359108e36864d8d9bcdf6acbe7a3b8335bd8;p=hibernate4-maven-plugin Fixed a bug when handling test-dependencies: XML-mappings were ignored --- diff --git a/src/it/transport/create.sql b/src/it/transport/create.sql new file mode 100644 index 00000000..a7f9d940 --- /dev/null +++ b/src/it/transport/create.sql @@ -0,0 +1,1105 @@ + + create table Category_Category ( + Category_id varchar(191) not null, + Category_nodeType integer not null, + Category_source VARCHAR(191) not null, + parents_id varchar(191) not null, + parents_nodeType integer not null, + parents_source VARCHAR(191) not null + ); + + create table Custom_Category ( + Custom_id varchar(191) not null, + Custom_nodeType integer not null, + Custom_source VARCHAR(191) not null, + categories_id varchar(191) not null, + categories_nodeType integer not null, + categories_source VARCHAR(191) not null + ); + + create table Custom_contributors ( + Custom_id varchar(191) not null, + Custom_nodeType integer not null, + Custom_source VARCHAR(191) not null, + contributor_id varchar(191), + contributor_nodeType integer, + contributor_source VARCHAR(191), + text varchar(511), + type varchar(255) + ); + + create table Custom_emails ( + Custom_id varchar(191) not null, + Custom_nodeType integer not null, + Custom_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Custom_links ( + Custom_id varchar(191) not null, + Custom_nodeType integer not null, + Custom_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Custom_numbers ( + Custom_id varchar(191) not null, + Custom_nodeType integer not null, + Custom_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Date_contributors ( + Date_id varchar(191) not null, + Date_nodeType integer not null, + Date_source VARCHAR(191) not null, + contributor_id varchar(191), + contributor_nodeType integer, + contributor_source VARCHAR(191), + text varchar(511), + type varchar(255) + ); + + create table Date_emails ( + Date_id varchar(191) not null, + Date_nodeType integer not null, + Date_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Date_links ( + Date_id varchar(191) not null, + Date_nodeType integer not null, + Date_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Date_numbers ( + Date_id varchar(191) not null, + Date_nodeType integer not null, + Date_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Date_types ( + Date_id varchar(191) not null, + Date_nodeType integer not null, + Date_source VARCHAR(191) not null, + types varchar(255) + ); + + create table Event_Category ( + Event_id varchar(191) not null, + Event_nodeType integer not null, + Event_source VARCHAR(191) not null, + categories_id varchar(191) not null, + categories_nodeType integer not null, + categories_source VARCHAR(191) not null + ); + + create table Event_contributors ( + Event_id varchar(191) not null, + Event_nodeType integer not null, + Event_source VARCHAR(191) not null, + contributor_id varchar(191), + contributor_nodeType integer, + contributor_source VARCHAR(191), + text varchar(511), + type varchar(255) + ); + + create table Event_emails ( + Event_id varchar(191) not null, + Event_nodeType integer not null, + Event_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Event_links ( + Event_id varchar(191) not null, + Event_nodeType integer not null, + Event_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Event_numbers ( + Event_id varchar(191) not null, + Event_nodeType integer not null, + Event_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table EventInfo_Group ( + nodeId varchar(191) not null, + nodeType integer not null, + source VARCHAR(191) not null, + groups_id varchar(191) not null, + groups_nodeType integer not null, + groups_source VARCHAR(191) not null + ); + + create table Exhibition_contributors ( + Exhibition_id varchar(191) not null, + Exhibition_nodeType integer not null, + Exhibition_source VARCHAR(191) not null, + contributor_id varchar(191), + contributor_nodeType integer, + contributor_source VARCHAR(191), + text varchar(511), + type varchar(255) + ); + + create table Exhibition_emails ( + Exhibition_id varchar(191) not null, + Exhibition_nodeType integer not null, + Exhibition_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Exhibition_hours ( + Exhibition_id varchar(191) not null, + Exhibition_nodeType integer not null, + Exhibition_source VARCHAR(191) not null, + close time, + day integer, + open time, + type varchar(255) + ); + + create table Exhibition_links ( + Exhibition_id varchar(191) not null, + Exhibition_nodeType integer not null, + Exhibition_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Exhibition_numbers ( + Exhibition_id varchar(191) not null, + Exhibition_nodeType integer not null, + Exhibition_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Group_contributors ( + Group_id varchar(191) not null, + Group_nodeType integer not null, + Group_source VARCHAR(191) not null, + contributor_id varchar(191), + contributor_nodeType integer, + contributor_source VARCHAR(191), + text varchar(511), + type varchar(255) + ); + + create table Group_emails ( + Group_id varchar(191) not null, + Group_nodeType integer not null, + Group_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Group_links ( + Group_id varchar(191) not null, + Group_nodeType integer not null, + Group_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Group_numbers ( + Group_id varchar(191) not null, + Group_nodeType integer not null, + Group_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table LegalPerson_Category ( + LegalPerson_id varchar(191) not null, + LegalPerson_nodeType integer not null, + LegalPerson_source VARCHAR(191) not null, + categories_id varchar(191) not null, + categories_nodeType integer not null, + categories_source VARCHAR(191) not null + ); + + create table LegalPerson_emails ( + LegalPerson_id varchar(191) not null, + LegalPerson_nodeType integer not null, + LegalPerson_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table LegalPerson_links ( + LegalPerson_id varchar(191) not null, + LegalPerson_nodeType integer not null, + LegalPerson_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table LegalPerson_numbers ( + LegalPerson_id varchar(191) not null, + LegalPerson_nodeType integer not null, + LegalPerson_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Location_Category ( + Location_id varchar(191) not null, + Location_nodeType integer not null, + Location_source VARCHAR(191) not null, + categories_id varchar(191) not null, + categories_nodeType integer not null, + categories_source VARCHAR(191) not null + ); + + create table Location_emails ( + Location_id varchar(191) not null, + Location_nodeType integer not null, + Location_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Location_hours ( + Location_id varchar(191) not null, + Location_nodeType integer not null, + Location_source VARCHAR(191) not null, + close time, + day integer, + open time, + type varchar(255) + ); + + create table Location_links ( + Location_id varchar(191) not null, + Location_nodeType integer not null, + Location_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Location_numbers ( + Location_id varchar(191) not null, + Location_nodeType integer not null, + Location_source VARCHAR(191) not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Node ( + DTYPE integer not null, + id varchar(191) not null, + nodeType integer not null, + source VARCHAR(191) not null, + created timestamp, + locale varchar(127), + modified timestamp, + name varchar(511), + version integer, + ord integer, + alt varchar(255), + copyright varchar(255), + credit varchar(255), + height integer, + width integer, + file varchar(255), + mediaType varchar(255), + size bigint, + teaser varchar(1023), + text varchar(4095), + uri varchar(255), + latitude double, + longitude double, + east double, + north double, + south double, + west double, + city varchar(127), + postalCode varchar(31), + street varchar(255), + firstName varchar(255), + lastName varchar(255), + type varchar(255), + end date, + start date, + gemkey varchar(31), + generator varchar(255), + after varchar(255), + date date, + photographer_id varchar(191), + photographer_nodeType integer, + photographer_source VARCHAR(191), + country_id varchar(191), + country_nodeType integer, + country_source VARCHAR(191), + state_id varchar(191), + state_nodeType integer, + state_source VARCHAR(191), + city_id varchar(191), + city_nodeType integer, + city_source VARCHAR(191), + district_id varchar(191), + district_nodeType integer, + district_source VARCHAR(191), + parent_id varchar(191), + parent_nodeType integer, + parent_source VARCHAR(191), + event_id varchar(191), + event_nodeType integer, + event_source VARCHAR(191), + location_id varchar(191), + location_nodeType integer, + location_source VARCHAR(191), + node_id varchar(191), + node_nodeType integer, + node_source VARCHAR(191), + subunit_id varchar(191), + subunit_nodeType integer, + subunit_source VARCHAR(191), + primary key (id, nodeType, source) + ); + + create table Node_features ( + Node_id varchar(191) not null, + Node_nodeType integer not null, + Node_source VARCHAR(191) not null, + features varchar(255) + ); + + create table Node_fields ( + Node_id varchar(191) not null, + Node_nodeType integer not null, + Node_source VARCHAR(191) not null, + fields varchar(255), + fields_KEY varchar(255) not null, + primary key (Node_id, Node_nodeType, Node_source, fields_KEY) + ); + + create table Node_Media ( + nodeId varchar(191) not null, + nodeType integer not null, + source VARCHAR(191) not null, + media_id varchar(191) not null, + media_nodeType integer not null, + media_source VARCHAR(191) not null + ); + + create table Node_Nodes ( + Node_id varchar(191) not null, + Node_nodeType integer not null, + Node_source VARCHAR(191) not null, + nodes_dbid bigint not null, + nodes_KEY varchar(255) not null, + primary key (Node_id, Node_nodeType, Node_source, nodes_KEY) + ); + + create table Nodes ( + dbid bigint generated by default as identity, + type varchar(255), + primary key (dbid) + ); + + create table Nodes_Node ( + Nodes_dbid bigint not null, + nodes_id varchar(191) not null, + nodes_nodeType integer not null, + nodes_source VARCHAR(191) not null + ); + + create table Organization_contributors ( + Organization_id varchar(191) not null, + Organization_nodeType integer not null, + Organization_source VARCHAR(191) not null, + contributor_id varchar(191), + contributor_nodeType integer, + contributor_source VARCHAR(191), + text varchar(511), + type varchar(255) + ); + + create table Place_Region ( + Place_id varchar(191) not null, + Place_nodeType integer not null, + Place_source VARCHAR(191) not null, + regions_id varchar(191) not null, + regions_nodeType integer not null, + regions_source VARCHAR(191) not null + ); + + create table Price ( + dbid bigint generated by default as identity, + currency varchar(255), + text varchar(255), + type varchar(255), + value double, + nodeId varchar(191), + nodeType integer, + source VARCHAR(191), + primary key (dbid) + ); + + create table Price_emails ( + Price_dbid bigint not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Price_links ( + Price_dbid bigint not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(1023) + ); + + create table Price_numbers ( + Price_dbid bigint not null, + extra varchar(255), + icon_id varchar(191), + icon_nodeType integer, + icon_source VARCHAR(191), + type varchar(255), + value varchar(255) + ); + + create table Region_City ( + Region_id varchar(191) not null, + Region_nodeType integer not null, + Region_source VARCHAR(191) not null, + cities_id varchar(191) not null, + cities_nodeType integer not null, + cities_source VARCHAR(191) not null + ); + + create table Source ( + uri VARCHAR(191) not null, + name varchar(255), + primary key (uri) + ); + + create table Source_features ( + Source_uri VARCHAR(191) not null, + features binary(255), + features_KEY varchar(255) not null, + primary key (Source_uri, features_KEY) + ); + + create table Source_types ( + Source_uri VARCHAR(191) not null, + types binary(255), + types_KEY varchar(255) not null, + primary key (Source_uri, types_KEY) + ); + + alter table Category_Category + add constraint UK_ed5lqxomulp7x8hcy3104lw7t unique (parents_id, parents_nodeType, parents_source); + + alter table Node + add constraint uri unique (source, nodeType, id, locale, version); + + alter table Category_Category + add constraint FKbtv4wjkjdxcopetysbong6ui6 + foreign key (parents_id, parents_nodeType, parents_source) + references Node; + + alter table Category_Category + add constraint FKkvdv0b6eqyobky9sah5hv2new + foreign key (Category_id, Category_nodeType, Category_source) + references Node; + + alter table Custom_Category + add constraint FK2o95493movsb6l1yw4n4khtbh + foreign key (categories_id, categories_nodeType, categories_source) + references Node; + + alter table Custom_Category + add constraint FK9k7jg7cp6xluljk2qt815tdjp + foreign key (Custom_id, Custom_nodeType, Custom_source) + references Node; + + alter table Custom_contributors + add constraint FKi7asp1dwf0b59mmrqjlhuspfe + foreign key (contributor_id, contributor_nodeType, contributor_source) + references Node; + + alter table Custom_contributors + add constraint FKthm0rsemcxntnnw2vqa9fbjtg + foreign key (Custom_id, Custom_nodeType, Custom_source) + references Node; + + alter table Custom_emails + add constraint FKphffh59qd5yhax6ompthaby5w + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Custom_emails + add constraint FKt2p150a9i7yores6qhhrxdlqg + foreign key (Custom_id, Custom_nodeType, Custom_source) + references Node; + + alter table Custom_links + add constraint FKoavtb3ysx30i4vkp1o9qha3x8 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Custom_links + add constraint FKdp6pu85ss0k17nhnhg8wt95qu + foreign key (Custom_id, Custom_nodeType, Custom_source) + references Node; + + alter table Custom_numbers + add constraint FKspyya70ibrtp0yp0aet1aulv0 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Custom_numbers + add constraint FK9n5qkj8uw768qyxluocmgp86l + foreign key (Custom_id, Custom_nodeType, Custom_source) + references Node; + + alter table Date_contributors + add constraint FKi6oc1dly4i431dvbh5p6bf8mk + foreign key (contributor_id, contributor_nodeType, contributor_source) + references Node; + + alter table Date_contributors + add constraint FKr39enr8uc3pjasjsvts2qk67t + foreign key (Date_id, Date_nodeType, Date_source) + references Node; + + alter table Date_emails + add constraint FKipovx7k7ccjs6ovv2p1squaqb + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Date_emails + add constraint FK8ewik7de7eruekfjln9wiw9u7 + foreign key (Date_id, Date_nodeType, Date_source) + references Node; + + alter table Date_links + add constraint FK56sagoqdlfivnhx9j64ffq0aq + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Date_links + add constraint FK2epditya9rqnwedje5clh9fst + foreign key (Date_id, Date_nodeType, Date_source) + references Node; + + alter table Date_numbers + add constraint FK8sybhsii1xwy1b6ay4yw29aad + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Date_numbers + add constraint FKpi1tiq27ga4vg10jpu3lcn00j + foreign key (Date_id, Date_nodeType, Date_source) + references Node; + + alter table Date_types + add constraint FKdwuqn78ynn843lq8qnay7m99d + foreign key (Date_id, Date_nodeType, Date_source) + references Node; + + alter table Event_Category + add constraint FK796bki6riterk5qhwwer52i7e + foreign key (categories_id, categories_nodeType, categories_source) + references Node; + + alter table Event_Category + add constraint FKoxnijth24p7efxasu8gbqglnh + foreign key (Event_id, Event_nodeType, Event_source) + references Node; + + alter table Event_contributors + add constraint FK1tegfyer7c6f6gvjaxum2qoh4 + foreign key (contributor_id, contributor_nodeType, contributor_source) + references Node; + + alter table Event_contributors + add constraint FK9nb0vn1fpg02lv1xqwrnymp2a + foreign key (Event_id, Event_nodeType, Event_source) + references Node; + + alter table Event_emails + add constraint FKgukmvw30p78pd01t0ub3yhl89 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Event_emails + add constraint FK44jxwok6hcnl26utfhmabp0w6 + foreign key (Event_id, Event_nodeType, Event_source) + references Node; + + alter table Event_links + add constraint FKh2cty42m9dcwee8jrbwcykd00 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Event_links + add constraint FKhnuhk1ebnx3lhblp9tobx2xkm + foreign key (Event_id, Event_nodeType, Event_source) + references Node; + + alter table Event_numbers + add constraint FKgpmu2w9h057i4412lhy35u8wk + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Event_numbers + add constraint FK7vkbmaxmvnycab6grkx1enack + foreign key (Event_id, Event_nodeType, Event_source) + references Node; + + alter table EventInfo_Group + add constraint FKpwna397y3jfavhfbi631jrfuc + foreign key (groups_id, groups_nodeType, groups_source) + references Node; + + alter table EventInfo_Group + add constraint FK7vvheht7xq6t8q60x0iwbbo8e + foreign key (nodeId, nodeType, source) + references Node; + + alter table Exhibition_contributors + add constraint FK5x96y7obyfslktrjb3lw5ksnf + foreign key (contributor_id, contributor_nodeType, contributor_source) + references Node; + + alter table Exhibition_contributors + add constraint FKhb6cddg2ut19lyqhvhkm3n8k6 + foreign key (Exhibition_id, Exhibition_nodeType, Exhibition_source) + references Node; + + alter table Exhibition_emails + add constraint FKrj3srkor5p48sqctfmqk7kndb + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Exhibition_emails + add constraint FK4hdpyj0v87bnl6qjs8q50esot + foreign key (Exhibition_id, Exhibition_nodeType, Exhibition_source) + references Node; + + alter table Exhibition_hours + add constraint FK27vcm7e9ercq01vac5vfjy8lp + foreign key (Exhibition_id, Exhibition_nodeType, Exhibition_source) + references Node; + + alter table Exhibition_links + add constraint FKd7q17uoid3jjmj5juqnn6kh3t + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Exhibition_links + add constraint FK9a6f7rvpeplqd2w7se00d6k7i + foreign key (Exhibition_id, Exhibition_nodeType, Exhibition_source) + references Node; + + alter table Exhibition_numbers + add constraint FK50xco0skes213iffdar4rsjdl + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Exhibition_numbers + add constraint FKr3esjj54fnif36h8khekq6cjl + foreign key (Exhibition_id, Exhibition_nodeType, Exhibition_source) + references Node; + + alter table Group_contributors + add constraint FKbmsmbeitqbq8iex4vylge405d + foreign key (contributor_id, contributor_nodeType, contributor_source) + references Node; + + alter table Group_contributors + add constraint FKf636sk9rghhtgj07a9b19ln5h + foreign key (Group_id, Group_nodeType, Group_source) + references Node; + + alter table Group_emails + add constraint FKmip0rdn17823nw0ev7j07658u + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Group_emails + add constraint FK7skv245m9v0iq1pksnqul1ljx + foreign key (Group_id, Group_nodeType, Group_source) + references Node; + + alter table Group_links + add constraint FKe52ogqykhxk91v8l6tnvwt1gn + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Group_links + add constraint FKd3p24awb4qhm7i7sqhm7gmw3y + foreign key (Group_id, Group_nodeType, Group_source) + references Node; + + alter table Group_numbers + add constraint FKadx9i37o50hkycey1s3q1uc97 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Group_numbers + add constraint FK4w1p7ivthda1sxpmt2py3n4r5 + foreign key (Group_id, Group_nodeType, Group_source) + references Node; + + alter table LegalPerson_Category + add constraint FKqqfb7yiroxuw542ni9p54ge6i + foreign key (categories_id, categories_nodeType, categories_source) + references Node; + + alter table LegalPerson_Category + add constraint FKq571u0kqnrtbw1kaebgp5o5b6 + foreign key (LegalPerson_id, LegalPerson_nodeType, LegalPerson_source) + references Node; + + alter table LegalPerson_emails + add constraint FK57r51bhrrtkphral2s5g8fliw + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table LegalPerson_emails + add constraint FKcw2plu6hr2x0cn9oif1vb8fnc + foreign key (LegalPerson_id, LegalPerson_nodeType, LegalPerson_source) + references Node; + + alter table LegalPerson_links + add constraint FK2n9qnfwvfu8np8w29h7k3323g + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table LegalPerson_links + add constraint FKqtqxdehi6fu72ko6odlbg6r3t + foreign key (LegalPerson_id, LegalPerson_nodeType, LegalPerson_source) + references Node; + + alter table LegalPerson_numbers + add constraint FKe37ecgbbetkxwlw77m973rqwe + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table LegalPerson_numbers + add constraint FKo2l34vktv5jnysok64g3wfqvq + foreign key (LegalPerson_id, LegalPerson_nodeType, LegalPerson_source) + references Node; + + alter table Location_Category + add constraint FKbpj9fd3vreu4hi2xpe2ll55vo + foreign key (categories_id, categories_nodeType, categories_source) + references Node; + + alter table Location_Category + add constraint FK5b6fpm548a7lgts68vhy7mcj4 + foreign key (Location_id, Location_nodeType, Location_source) + references Node; + + alter table Location_emails + add constraint FKn2xd9u1a04ks23nd0ussna3rq + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Location_emails + add constraint FKckgpp1j0ob5bspu854g61goko + foreign key (Location_id, Location_nodeType, Location_source) + references Node; + + alter table Location_hours + add constraint FK2fgc24b4d2v3pu1opsfvowt3o + foreign key (Location_id, Location_nodeType, Location_source) + references Node; + + alter table Location_links + add constraint FK22oj3jm0qo3ylcojflryeovsj + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Location_links + add constraint FKr1c5cxw7f0kea4e6jf3t4wwbl + foreign key (Location_id, Location_nodeType, Location_source) + references Node; + + alter table Location_numbers + add constraint FKn5fopoumjl9peoc0wydq0y7if + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Location_numbers + add constraint FKr5k04mtbvfnbof26m75de5ujl + foreign key (Location_id, Location_nodeType, Location_source) + references Node; + + alter table Node + add constraint FK9ted8q3xnwgdae6r2b6a2j2c8 + foreign key (photographer_id, photographer_nodeType, photographer_source) + references Node; + + alter table Node + add constraint FKdbvdgnv0766xu7jlxwghad4oq + foreign key (country_id, country_nodeType, country_source) + references Node; + + alter table Node + add constraint FKkh3kdosgk406i59pksttr398b + foreign key (state_id, state_nodeType, state_source) + references Node; + + alter table Node + add constraint FKqwd2vxgkcydcohnw9xuxu4w8n + foreign key (city_id, city_nodeType, city_source) + references Node; + + alter table Node + add constraint FKcfsvjllpwnsrxy2qkv2fg1wli + foreign key (district_id, district_nodeType, district_source) + references Node; + + alter table Node + add constraint FKhuf20tlghhk21gs0n65cdgwxh + foreign key (parent_id, parent_nodeType, parent_source) + references Node; + + alter table Node + add constraint FK3t7obkasckpeh8lam3gul13k + foreign key (event_id, event_nodeType, event_source) + references Node; + + alter table Node + add constraint FK5v23em75p47f86muwm34i6ibk + foreign key (location_id, location_nodeType, location_source) + references Node; + + alter table Node + add constraint FKnsy9f76nf7ocajkfuuvxmv5g7 + foreign key (node_id, node_nodeType, node_source) + references Node; + + alter table Node + add constraint FK6udg7k9o0ffj9lesyf3a12pqr + foreign key (subunit_id, subunit_nodeType, subunit_source) + references Node; + + alter table Node_features + add constraint FKrq26l7t2c19663gew9ml6cvud + foreign key (Node_id, Node_nodeType, Node_source) + references Node; + + alter table Node_fields + add constraint FKneblsglqyju4ma3kpju4c7orq + foreign key (Node_id, Node_nodeType, Node_source) + references Node; + + alter table Node_Media + add constraint FKn0qdv3hrutqr6r0umned27d4c + foreign key (media_id, media_nodeType, media_source) + references Node; + + alter table Node_Media + add constraint FK1xaqp7wwyf36aporbvniekdrv + foreign key (nodeId, nodeType, source) + references Node; + + alter table Node_Nodes + add constraint FKi3m2oeejpb1njux7j14pvo16b + foreign key (nodes_dbid) + references Nodes; + + alter table Node_Nodes + add constraint FKee84dn6iionubhwkf575y9vax + foreign key (Node_id, Node_nodeType, Node_source) + references Node; + + alter table Nodes_Node + add constraint FKq8jht9sf4j6k5qo8cuwn65cbo + foreign key (nodes_id, nodes_nodeType, nodes_source) + references Node; + + alter table Nodes_Node + add constraint FKjp2exc3ajmkmmt4oa151243e + foreign key (Nodes_dbid) + references Nodes; + + alter table Organization_contributors + add constraint FKdr4ufvx8juh8jpq913j63mvjy + foreign key (contributor_id, contributor_nodeType, contributor_source) + references Node; + + alter table Organization_contributors + add constraint FKlda1w56spi8gim216xocg2n5t + foreign key (Organization_id, Organization_nodeType, Organization_source) + references Node; + + alter table Place_Region + add constraint FK1barpdkpy4p8f2tcgwhqaay1n + foreign key (regions_id, regions_nodeType, regions_source) + references Node; + + alter table Place_Region + add constraint FK3gga17h07k8awue3capjepjb2 + foreign key (Place_id, Place_nodeType, Place_source) + references Node; + + alter table Price + add constraint FKson2y4hg9osya48c5idq0kguk + foreign key (nodeId, nodeType, source) + references Node; + + alter table Price_emails + add constraint FK7j7cjie0a3qemqlgwlxqqlc92 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Price_emails + add constraint FKq6ito5fik1kniadn6cwqm0l9f + foreign key (Price_dbid) + references Price; + + alter table Price_links + add constraint FKobn3hdtitjci6trqdwnrmj7m2 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Price_links + add constraint FKhmji8edy6h9017ktwlrr9vmw + foreign key (Price_dbid) + references Price; + + alter table Price_numbers + add constraint FK4xahu5ppk7qmu1g6toypk0a13 + foreign key (icon_id, icon_nodeType, icon_source) + references Node; + + alter table Price_numbers + add constraint FKiejn1brgdrrpflwykhlpw0w4n + foreign key (Price_dbid) + references Price; + + alter table Region_City + add constraint FKogds6ncpkoqv484wign95w0sd + foreign key (cities_id, cities_nodeType, cities_source) + references Node; + + alter table Region_City + add constraint FKhifiimy7x0ksxh6ffenvqw38t + foreign key (Region_id, Region_nodeType, Region_source) + references Node; + + alter table Source_features + add constraint FKbowlk95psbed0re5f8b2x8xch + foreign key (Source_uri) + references Source; + + alter table Source_types + add constraint FK2miu98q4nc71gepck5sx3v7ye + foreign key (Source_uri) + references Source; diff --git a/src/it/transport/drop.sql b/src/it/transport/drop.sql new file mode 100644 index 00000000..d8954e89 --- /dev/null +++ b/src/it/transport/drop.sql @@ -0,0 +1,104 @@ + + drop table Category_Category if exists; + + drop table Custom_Category if exists; + + drop table Custom_contributors if exists; + + drop table Custom_emails if exists; + + drop table Custom_links if exists; + + drop table Custom_numbers if exists; + + drop table Date_contributors if exists; + + drop table Date_emails if exists; + + drop table Date_links if exists; + + drop table Date_numbers if exists; + + drop table Date_types if exists; + + drop table Event_Category if exists; + + drop table Event_contributors if exists; + + drop table Event_emails if exists; + + drop table Event_links if exists; + + drop table Event_numbers if exists; + + drop table EventInfo_Group if exists; + + drop table Exhibition_contributors if exists; + + drop table Exhibition_emails if exists; + + drop table Exhibition_hours if exists; + + drop table Exhibition_links if exists; + + drop table Exhibition_numbers if exists; + + drop table Group_contributors if exists; + + drop table Group_emails if exists; + + drop table Group_links if exists; + + drop table Group_numbers if exists; + + drop table LegalPerson_Category if exists; + + drop table LegalPerson_emails if exists; + + drop table LegalPerson_links if exists; + + drop table LegalPerson_numbers if exists; + + drop table Location_Category if exists; + + drop table Location_emails if exists; + + drop table Location_hours if exists; + + drop table Location_links if exists; + + drop table Location_numbers if exists; + + drop table Node if exists; + + drop table Node_features if exists; + + drop table Node_fields if exists; + + drop table Node_Media if exists; + + drop table Node_Nodes if exists; + + drop table Nodes if exists; + + drop table Nodes_Node if exists; + + drop table Organization_contributors if exists; + + drop table Place_Region if exists; + + drop table Price if exists; + + drop table Price_emails if exists; + + drop table Price_links if exists; + + drop table Price_numbers if exists; + + drop table Region_City if exists; + + drop table Source if exists; + + drop table Source_features if exists; + + drop table Source_types if exists; diff --git a/src/it/transport/pom.xml b/src/it/transport/pom.xml new file mode 100644 index 00000000..4f6b94fd --- /dev/null +++ b/src/it/transport/pom.xml @@ -0,0 +1,182 @@ + + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 1.5.1.RELEASE + + + de.juplo.yourshouter.api + transport-MINIMAL-FOR-HIBERNATE-MAVEN-PLUGIN-TEST + 1.5.1 + yourSHOUTER - API - Transport + Transport-Helper-Classes for the REST-API + + + yourSHOUTER UG (haftungsbeschränkt) + http://yourshouter.com/projekte/crowdgestützte-veranstaltungs-suchmaschine.html + + + + + + + 1.8 + + + com.h2database + h2 + ${h2.version} + org.h2.Driver + org.hibernate.dialect.H2Dialect + + sa + + + + 1.5.1 + 1.0.0 + 1.5.1 + 1.5.1 + 1.5.1 + 1.5.1 + + + + + + + de.juplo.yourshouter.api + storage + ${storage.version} + + + + + de.juplo.yourshouter.api + persistence + ${persistence.version} + test-jar + test + + + de.juplo.yourshouter.api + data-model + ${data-model.version} + test-jar + test + + + de.juplo.yourshouter.api + storage + ${storage.version} + test-jar + test + + + de.juplo.yourshouter.api + persistence-jpa + ${persistence-jpa.version} + test + + + de.juplo + jpa-converters + ${jpa-converters.version} + test + + + de.juplo.yourshouter.api + persistence-jpa + ${persistence-jpa.version} + test-jar + test + + + de.juplo.yourshouter.api + persistence-mem + ${persistence-mem.version} + test + + + de.juplo.yourshouter.api + persistence-mem + ${persistence-mem.version} + test-jar + test + + + + ${jdbc.groupId} + ${jdbc.artifactId} + ${jdbc.version} + test + + + + + + + + false + + juplo + Repository for internal artifacts on juplo.de + http://juplo.de/maven2 + + + + + + juplo + Repository for internal artifacts on juplo.de + scpexe://juplo.de/var/www/juplo.de/maven2 + + + + + + + de.juplo + hibernate-maven-plugin + @project.version@ + + true + true + true + ${jdbc.url} + ${jdbc.username} + ${jdbc.password} + ${jdbc.driver-class-name} + ${jdbc.dialect} + test + + + + Execute Drop-Schema + + drop + + + + Execute Create-Schema + + create + + + + + + ${jdbc.groupId} + ${jdbc.artifactId} + ${jdbc.version} + + + + + + + diff --git a/src/it/transport/verify.bsh b/src/it/transport/verify.bsh new file mode 100644 index 00000000..68be27ce --- /dev/null +++ b/src/it/transport/verify.bsh @@ -0,0 +1,9 @@ +import de.juplo.test.FileComparator; + + +FileComparator comparator = new FileComparator(basedir); + +if (!comparator.isEqual("drop.sql","target/drop.sql")) + return false; +if (!comparator.isEqual("create.sql","target/create.sql")) + return false; diff --git a/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java b/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java index 0f143f59..41c55ded 100644 --- a/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java @@ -485,11 +485,16 @@ public abstract class AbstractSchemaMojo extends AbstractMojo Properties properties = new Properties(); ConfigLoader configLoader = new ConfigLoader(bootstrapServiceRegitry); - /** Loading and merging configuration */ + /** Loading configuration */ properties.putAll(loadProperties(configLoader)); LoadedConfig config = loadConfig(configLoader); if (config != null) properties.putAll(config.getConfigurationValues()); + + /** Add the remaining class-path-elements */ + addDirectDependenciesClassPath(classLoader); + + /** Loading and merging configuration from persistence-unit(s) */ ParsedPersistenceXmlDescriptor unit = loadPersistenceUnit(classLoaderService, properties); if (unit != null) @@ -518,7 +523,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo final MetadataSources sources = new MetadataSources(serviceRegistry); /** Add the remaining class-path-elements */ - completeClassPath(classLoader); + addAllDependenciesToClassPath(classLoader); /** Apply mappings from hibernate-configuration, if present */ if (config != null) @@ -534,6 +539,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo if (scanClasses == null) scanClasses = true; Set urls = new HashSet(); + getLog().debug("Compiling the dependencies, that are scanned for annotated classes"); if (scanClasses) addRoot(urls, outputDirectory); if (scanTestClasses) @@ -546,19 +552,28 @@ public abstract class AbstractSchemaMojo extends AbstractMojo /** Follow configuration in persisten unit */ if (scanClasses == null) scanClasses = !unit.isExcludeUnlistedClasses(); + getLog().debug("Compiling the dependencies, that are scanned for annotated classes"); + Set urls = new HashSet(); if (scanClasses) { + getLog().debug("Only dependencies relative to persistent-unit " + unit.getName() + " are scanned!"); /** * Scan the root of the persiten unit and configured jars for * annotated classes */ + getLog().debug(" - adding " + unit.getPersistenceUnitRootUrl()); urls.add(unit.getPersistenceUnitRootUrl()); for (URL url : unit.getJarFileUrls()) + { + getLog().debug(" - adding " + url); urls.add(url); + } + if (scanTestClasses) + addRoot(urls, testOutputDirectory); } - if (scanTestClasses) - addRoot(urls, testOutputDirectory); + else + getLog().debug("Scanning of unlisted classes is prohibited in persistent-unit " + unit.getName()); classes = scanUrls(urls); for (String className : unit.getManagedClassNames()) classes.add(className); @@ -591,9 +606,10 @@ public abstract class AbstractSchemaMojo extends AbstractMojo * Add mappings from files, that are explicitly configured in the * persistence unit */ + getLog().info("Adding mappings from persistence-unit " + unit.getName()); for (String mapping : unit.getMappingFileNames()) { - getLog().info("Adding explicitly configured mapping from " + mapping); + getLog().info(" - adding " + mapping); is = classLoader.getResourceAsStream(mapping); if (is != null) { @@ -828,20 +844,39 @@ public abstract class AbstractSchemaMojo extends AbstractMojo } } - private void completeClassPath(MutableClassLoader classLoader) + private void addDirectDependenciesClassPath(MutableClassLoader classLoader) throws MojoExecutionException { try { - getLog().debug("Completing class-paths of the ClassLoader for project-dependencies..."); - List classpathFiles = project.getCompileClasspathElements(); + getLog().debug("Adding all direct project-dependencies to the ClassLoader..."); + LinkedHashSet urls = new LinkedHashSet(); + addDependencies(urls); if (scanTestClasses) - classpathFiles.addAll(project.getTestClasspathElements()); + addRoot(urls, testOutputDirectory); + classLoader.add(urls); + } + catch (Exception e) + { + getLog().error("Error while creating ClassLoader!", e); + throw new MojoExecutionException(e.getMessage()); + } + } + + private void addAllDependenciesToClassPath(MutableClassLoader classLoader) + throws + MojoExecutionException + { + try + { + getLog().debug("Adding all project-dependencies to the ClassLoader..."); + List classpathFiles = project.getCompileClasspathElements(); + classpathFiles.addAll(project.getTestClasspathElements()); LinkedHashSet urls = new LinkedHashSet(); for (String pathElement : classpathFiles) { - getLog().debug("Dependency: " + pathElement); + getLog().debug(" - adding " + pathElement); urls.add(new File(pathElement).toURI().toURL()); } classLoader.add(urls); @@ -1160,9 +1195,9 @@ public abstract class AbstractSchemaMojo extends AbstractMojo // TODO: add support to read all mappings under a directory throw new MojoFailureException(file.getAbsolutePath() + " is a directory"); if (tracker.track(filename, new FileInputStream(file))) - getLog().debug("Found new or modified mapping-file: " + filename); + getLog().debug(" - found new or modified mapping-file: " + filename); else - getLog().debug("Mapping-file unchanged: " + filename); + getLog().debug(" - mapping-file unchanged: " + filename); sources.addFile(file); } @@ -1184,12 +1219,12 @@ public abstract class AbstractSchemaMojo extends AbstractMojo File dir = new File(path); if (dir.exists()) { - getLog().info("Adding " + dir.getAbsolutePath() + " to the list of roots to scan..."); + getLog().info(" - adding " + dir.getAbsolutePath()); urls.add(dir.toURI().toURL()); } else getLog().warn( - "the directory cannot be scanned for annotated classes, " + + "The directory cannot be scanned for annotated classes, " + "because it does not exist: " + dir.getAbsolutePath() ); @@ -1210,7 +1245,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo Matcher matcher = SPLIT.matcher(scanDependencies); while (matcher.find()) { - getLog().info("Adding dependencies from scope " + matcher.group() + " to the list of roots to scan"); + getLog().debug("Adding dependencies from scope " + matcher.group() + " to the list of roots to scan"); for (Artifact artifact : project.getDependencyArtifacts()) { if (!artifact.getScope().equalsIgnoreCase(matcher.group())) @@ -1220,7 +1255,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo getLog().warn("Cannot add dependency " + artifact.getId() + ": no JAR-file available!"); continue; } - getLog().info("Adding dependencies from scope " + artifact.getId() + " to the list of roots to scan"); + getLog().debug(" - adding " + artifact.getId()); urls.add(artifact.getFile().toURI().toURL()); } }