About Question com.enthuware.ets.scbcd.v5.2.96 :

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by ETS User »

*Class files, persistence.xml file, and orm.xml
orm.xml will always be examined because any mapping information given in orm.xml overrides the information present in the classes in the form of annotations. Class files are usually examined but are ignored when xml-mapping-metadata-complete subelement is set to true in the xml files.

Hello,

I think that this option is true (not the forth), for example

This is a class

Code: Select all

public class Author extends Identifiable {
	private String name;
	@Column(name="ADDRESS")
	private String address;
	
	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	@Override
	public String toString() {
		return "Author [name=" + name + ", books=" + getBooks() + "]";
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}
	
}
and this is a part of orm.xml:

Code: Select all

	<entity class="Author">
		<table name="AUTHOR"></table>
	</entity>
In this case persistent provider how to know the Author in orm.xml override the Author.class, it must examine the class file in every case to know that whether orm.xml may or may not override.

admin
Site Admin
Posts: 10064
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by admin »

Hello,
As noted in the explanation Class files are ignored when xml-mapping-metadata-complete subelement is set to true in the xml files. Therefore, option 3 is not correct.
In this question, contents of persistence.xml file, and orm.xml are not specified so you cannot say that classes will be examined.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Guest

Re: About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by Guest »

Thanks, that makes sense to me!

neo

Re: About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by neo »

Since xml-mapping-metadata-complete subelement is not mentioned in question. The correct answer would be 4.

This questions is subjective.

Best regards

neo

Re: About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by neo »

Rectifying,

The correct would be option 3.

Guest

Re: About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by Guest »

Anyone has advice?

admin
Site Admin
Posts: 10064
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scbcd.v5.2.96 :

Post by admin »

Hello,
As I already mentioned in my previous reply, "In this question, contents of persistence.xml file, and orm.xml are not specified so you cannot say that classes will be examined."

So you cannot assume that xml-mapping-metadata-complete present or absent.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 79 guests