parent
c4026806a6
commit
c2f649df54
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.orm.jpa.mapping;
|
||||
|
||||
/**
|
||||
* A non annotated entity that is handled by a custom "mapping-file".
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class NonAnnotatedEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String value;
|
||||
|
||||
protected NonAnnotatedEntity() {
|
||||
}
|
||||
|
||||
public NonAnnotatedEntity(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd"
|
||||
version="2.1">
|
||||
<entity class="org.springframework.boot.autoconfigure.orm.jpa.mapping.NonAnnotatedEntity">
|
||||
<table name="NON_ANNOTATED"/>
|
||||
<attributes>
|
||||
<id name="id">
|
||||
<column name="id"/>
|
||||
<generated-value strategy="IDENTITY"/>
|
||||
</id>
|
||||
<basic name="value">
|
||||
<column name="value"/>
|
||||
</basic>
|
||||
</attributes>
|
||||
</entity>
|
||||
</entity-mappings>
|
@ -0,0 +1 @@
|
||||
INSERT INTO NON_ANNOTATED (ID, VALUE) values (2000, 'Test');
|
Loading…
Reference in New Issue