-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #198 - Added detection of the join column source to be able to …
…determine if single valued association ids should be rendered
- Loading branch information
Showing
27 changed files
with
593 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...estsuite/src/main/java/com/blazebit/persistence/testsuite/entity/DocumentForOneToOne.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2014 - 2017 Blazebit. | ||
* | ||
* 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 com.blazebit.persistence.testsuite.entity; | ||
|
||
import javax.persistence.Basic; | ||
import javax.persistence.Entity; | ||
import javax.persistence.OneToOne; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
* @author Christian Beikov | ||
* @since 1.2.0 | ||
*/ | ||
@Entity | ||
public class DocumentForOneToOne extends Ownable implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private String name; | ||
private DocumentInfo documentInfo; | ||
private DocumentInfo documentInfo2; | ||
|
||
@Basic(optional = false) | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
@OneToOne(mappedBy = "document") | ||
public DocumentInfo getDocumentInfo() { | ||
return documentInfo; | ||
} | ||
|
||
public void setDocumentInfo(DocumentInfo documentInfo) { | ||
this.documentInfo = documentInfo; | ||
} | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
...src/main/java/com/blazebit/persistence/testsuite/entity/DocumentForOneToOneJoinTable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2014 - 2017 Blazebit. | ||
* | ||
* 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 com.blazebit.persistence.testsuite.entity; | ||
|
||
import javax.persistence.Basic; | ||
import javax.persistence.Entity; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.JoinTable; | ||
import javax.persistence.OneToOne; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
* @author Christian Beikov | ||
* @since 1.2.0 | ||
*/ | ||
@Entity | ||
public class DocumentForOneToOneJoinTable extends Ownable implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private String name; | ||
private DocumentInfo documentInfoJoinTable; | ||
|
||
@Basic(optional = false) | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
@OneToOne | ||
@JoinTable( | ||
name = "document_extra", | ||
joinColumns = @JoinColumn(name = "document_id", referencedColumnName = "id"), | ||
inverseJoinColumns = @JoinColumn(name = "document_info_id", referencedColumnName = "id") | ||
) | ||
public DocumentInfo getDocumentInfoJoinTable() { | ||
return documentInfoJoinTable; | ||
} | ||
|
||
public void setDocumentInfoJoinTable(DocumentInfo documentInfoJoinTable) { | ||
this.documentInfoJoinTable = documentInfoJoinTable; | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
core/testsuite/src/main/java/com/blazebit/persistence/testsuite/entity/DocumentInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright 2014 - 2017 Blazebit. | ||
* | ||
* 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 com.blazebit.persistence.testsuite.entity; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.OneToOne; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
* @author Christian Beikov | ||
* @since 1.2.0 | ||
*/ | ||
@Entity | ||
public class DocumentInfo implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private Long id; | ||
private DocumentForOneToOne document; | ||
private String someInfo; | ||
|
||
@Id | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
@OneToOne | ||
@JoinColumn(name = "document_id") | ||
public DocumentForOneToOne getDocument() { | ||
return document; | ||
} | ||
|
||
public void setDocument(DocumentForOneToOne document) { | ||
this.document = document; | ||
} | ||
|
||
public String getSomeInfo() { | ||
return someInfo; | ||
} | ||
|
||
public void setSomeInfo(String someInfo) { | ||
this.someInfo = someInfo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.