forked from Blazebit/blaze-persistence
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Blazebit#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
24 changed files
with
479 additions
and
127 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
70 changes: 70 additions & 0 deletions
70
...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,70 @@ | ||
/* | ||
* 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 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; | ||
} | ||
|
||
@OneToOne | ||
@JoinTable( | ||
name = "document_extra", | ||
joinColumns = @JoinColumn(name = "document_id", referencedColumnName = "id"), | ||
inverseJoinColumns = @JoinColumn(name = "document_info_id", referencedColumnName = "id") | ||
) | ||
public DocumentInfo getDocumentInfo2() { | ||
return documentInfo2; | ||
} | ||
|
||
public void setDocumentInfo2(DocumentInfo documentInfo2) { | ||
this.documentInfo2 = documentInfo2; | ||
} | ||
} |
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
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.